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

This commit is contained in:
Francis Lachapelle
2021-09-22 13:33:38 -04:00
parent 4397e6a2e1
commit 60dabb7787
2 changed files with 4 additions and 2 deletions

View File

@@ -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;

View File

@@ -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