From 2e49702e3f2293816b8903c713e8a7bb5014dabd Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Tue, 29 May 2012 17:24:24 +0000 Subject: [PATCH] See ChangeLog. Monotone-Parent: f51ae70ff345179926dfdd4fd5856e968bdfc327 Monotone-Revision: 1e79eab4c546452715e5171f1c326b7d36f1c195 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2012-05-29T17:24:24 --- SOPE/NGCards/ChangeLog | 8 ++++++++ SOPE/NGCards/iCalRecurrenceCalculator.m | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) 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]; } }