Open FunnyerFeng opened 4 years ago
Agree, we met the same problem. When the App stand more than one day. The gray shadow for "today" is mark in wrong day.
Do not exit APP,Lock screen let it stand for a day and then unlock it . because: _today = [self.gregorian dateBySettingHour:0 minute:0 second:0 ofDate:[NSDate date] options:0]; so "today" is Still the day of the lock screen.
I find the solution: observe NSCalendarDayChangedNotification event. This will be called when day change, then call setToday to update FSCalendar.
Is anyone creating a PR to fix this issue?
Additionally, the following line should not be inside setToday
method:
FSCalendarAssertDateInBounds(today,self.gregorian,self.minimumDate,self.maximumDate);
In my case, I'm setting calendar minimumDate
, maxinumDate
properties, however those properties have nothing to do with circling "Today" correctly on the calendar.
Consider the following example, in which minimumDate
is set to Jun/12 and today is Jun/11. In this specific case, because today
property was set during initialization, minimumDate
was still not set, hence it works as expected. But if you set today
property to Jun/11 anytime after initialization, an exception will be thrown, while the expected result is that NO exception should happen.
Do not exit APP,Lock screen let it stand for a day and then unlock it . because: _today = [self.gregorian dateBySettingHour:0 minute:0 second:0 ofDate:[NSDate date] options:0]; so "today" is Still the day of the lock screen.