CalendarListview icon indicating copy to clipboard operation
CalendarListview copied to clipboard

wrong days number in February in leap year

Open semenoh opened this issue 10 years ago • 1 comments

Hi, I notice one thing which is probably related to days count in February when it is not leap year. For instance February 2015 ends with Sunday 29th and March begins with Sunday 1st. First thing was that March should start with Monday 1st but 2015 is not leap year so February should ends with Saturday 28th.

P.S. I have screenshot by I don't know how to attach it here.

UPD:

CalendarUtils class contains line:

return ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) ? 28 : 29;

which means that leap year contain 28 and regular 29 days. Just switch 28 and 29 like this

return ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) ? 29 : 28;

semenoh avatar Jan 15 '15 10:01 semenoh

I find the same bug

msunshinelxl avatar Feb 08 '15 08:02 msunshinelxl