MDCalendar icon indicating copy to clipboard operation
MDCalendar copied to clipboard

It seems that the method `numberOfMonthsUntilEndDate` can be wrong

Open xilin opened this issue 10 years ago • 2 comments

The method numberOfMonthsUntilEndDate written in
https://github.com/distefam/MDCalendar/blob/master/MDCalendar/NSDate%2BMDCalendar.m#L164 can be wrong when the day of start date is larger than the day of end date.

For example, if the start date is '2015-07-20' and the end date is '2015-08-10', the method will return 0, which will result in only showing July in calendar.

xilin avatar Jul 23 '15 05:07 xilin

I know this is ancient, but the function itself sounds like it's functioning fine. There are 0 full months between that start and end date (or even a minimum number of days to comprise a month). The implementation that depends on it might be wrong though.

laposheureux avatar Nov 09 '16 09:11 laposheureux

@laposheureux It did makes sense.

xilin avatar Nov 10 '16 06:11 xilin