Fix condition in weekly recurrence calculator

pull/230/head
Francis Lachapelle 2016-11-03 15:26:38 -04:00
parent cdae46c7c1
commit 7d1549250d
2 changed files with 5 additions and 6 deletions

View File

@ -163,8 +163,7 @@
{
r = [NGCalendarDateRange calendarDateRangeWithStartDate: currentStartDate
endDate: currentEndDate];
if ([_r containsDateRange: r] || [_r doesIntersectWithDateRange: r])
[ranges addObject: r];
[ranges addObject: r];
}
}
}

View File

@ -126,16 +126,16 @@
while ([currentStartDate compare: endDate] == NSOrderedAscending ||
[currentStartDate compare: endDate] == NSOrderedSame)
{
currentEndDate = [currentStartDate addTimeInterval: [firstRange duration]];
if ([startDate compare: currentStartDate] == NSOrderedAscending ||
[startDate compare: currentStartDate] == NSOrderedSame)
[startDate compare: currentStartDate] == NSOrderedSame ||
[startDate compare: currentEndDate] == NSOrderedAscending)
{
NGCalendarDateRange *r;
currentEndDate = [currentStartDate addTimeInterval: [firstRange duration]];
r = [NGCalendarDateRange calendarDateRangeWithStartDate: currentStartDate
endDate: currentEndDate];
if ([_r containsDateRange: r])
[ranges addObject: r];
[ranges addObject: r];
}
i++;
currentStartDate = [firStart dateByAddingYears: 0