diff --git a/SOPE/NGCards/ChangeLog b/SOPE/NGCards/ChangeLog index 5e7f0c1ca..28740b538 100644 --- a/SOPE/NGCards/ChangeLog +++ b/SOPE/NGCards/ChangeLog @@ -1,3 +1,11 @@ +2012-05-29 Francis Lachapelle + + * iCalRecurrenceCalculator.m + (_removeExceptionDatesFromRanges:withDates:withinRange:startingWithDate:): + when removing exception dates, avoid removing dates matching the + end date of the occurrence. This fixes an issue with all-day + daily events. + 2012-04-23 Wolfgang Sourdeau * iCalMonthlyRecurrenceCalculator.m (NGMonthDaySet_clear): make diff --git a/SOPE/NGCards/iCalRecurrenceCalculator.m b/SOPE/NGCards/iCalRecurrenceCalculator.m index 284e74b2a..7e60c0d9a 100644 --- a/SOPE/NGCards/iCalRecurrenceCalculator.m +++ b/SOPE/NGCards/iCalRecurrenceCalculator.m @@ -189,6 +189,7 @@ static Class yearlyCalcClass = Nil; NSCalendarDate *currentDate; NGCalendarDateRange *currentRange; unsigned int count, maxRanges; + NSComparisonResult compare; dates = [[self _dates: exdates withinRange: limits] objectEnumerator]; while ((currentDate = [dates nextObject])) @@ -197,7 +198,9 @@ static Class yearlyCalcClass = Nil; for (count = maxRanges; count > 0; count--) { currentRange = [ranges objectAtIndex: count - 1]; - if ([currentRange containsDate: currentDate]) + compare = [[currentRange startDate] compare: currentDate]; + if ((compare == NSOrderedAscending || compare == NSOrderedSame) && + [[currentRange endDate] compare: currentDate] == NSOrderedDescending) [ranges removeObjectAtIndex: count - 1]; } }