Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: getSelectedDay() with default value returns wrong month #11

Closed
tomdaniel-it opened this issue Apr 30, 2018 · 1 comment
Closed

Comments

@tomdaniel-it
Copy link
Contributor

When nothing has been selected yet, the method getSelectedDay() (in CollapsibleCalendar) will return a Day object created with the day, month & year from Calendar, but with month, a +1 is added. This is inconsistent since the normal value when something is selected does not do a +1.
Calendar.get(2) returns the month starting from 0 - 11. With the +1, it changes to 1-12.
So: when nothing in calendar has been clicked yet, day.getMonth() returns 4. When I then click on the day of today, that day gets selected. Then day.getMonth() prints out 3. (day == getSelectedDay())
Recommendation:
In CollapsibleCalendar in getSelectedDay() change:
return new Day(year, month + 1, day);
to:
return new Day(year, month, day);

@JSBerrocoso
Copy link

Same issue. Is Solved in other lib version??

karangoel16 added a commit to karangoel16/Collapsible-Calendar-View-Android that referenced this issue Nov 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants