KosherCocoa icon indicating copy to clipboard operation
KosherCocoa copied to clipboard

Bug in KCJewishCalendar.m -workingDateAdjustedForSunset implementation

Open Benny-iPhone opened this issue 5 years ago • 0 comments

Code is: BOOL isAfterSunset = [[self sunset] timeIntervalSinceNow] < 0;

Which might be correct when testing current time. But when check for future/past time (or running a unit-test) this can lead to an error. I think it's better to compare to workingDate like the next implementation:

BOOL isAfterSunset = (self.workingDate.timeIntervalSince1970 - [self sunset].timeIntervalSince1970) > 0;

Benny-iPhone avatar Sep 23 '20 21:09 Benny-iPhone