calendar: fix weekly/monthly calculators when event has no duration

This commit is contained in:
Francis Lachapelle committed 2021-09-22 13:33:38 -04:00
1 parent 4397e6a2e1
commit 60dabb7787
2 files changed
+4 -2

No files matched your search

@@ -135,7 +135,8 @@
[currentStartDate compare: endDate] == NSOrderedSame)
{
currentEndDate = [currentStartDate addTimeInterval: [firstRange duration]];
if ([startDate compare: currentEndDate] == NSOrderedAscending)
if ([startDate compare: currentEndDate] == NSOrderedAscending ||
([firstRange duration] == 0 && [startDate compare: currentEndDate] == NSOrderedSame))
{
NGCalendarDateRange *r;
@@ -216,7 +216,8 @@
months: 0
days: 0];
[start setTimeZone: [firStart timeZone]];
if ([start compare: rEnd] == NSOrderedAscending)
if ([start compare: rEnd] == NSOrderedAscending ||
([firstRange duration] == 0 && [start compare: rEnd] == NSOrderedSame))
{
end = [start addTimeInterval: [firstRange duration]];
r = [NGCalendarDateRange calendarDateRangeWithStartDate: start