diff --git a/SOPE/NGCards/ChangeLog b/SOPE/NGCards/ChangeLog index e5922829f..921859fca 100644 --- a/SOPE/NGCards/ChangeLog +++ b/SOPE/NGCards/ChangeLog @@ -1,3 +1,9 @@ +2012-08-31 Francis Lachapelle + + * iCalWeeklyRecurrenceCalculator.m + (-recurrenceRangesWithinCalendarDateRange:): the week counter must + start at 0 when there's no day mask. + 2012-08-22 Francis Lachapelle * iCalWeeklyRecurrenceCalculator.m diff --git a/SOPE/NGCards/iCalWeeklyRecurrenceCalculator.m b/SOPE/NGCards/iCalWeeklyRecurrenceCalculator.m index 140d05531..ad2812e15 100644 --- a/SOPE/NGCards/iCalWeeklyRecurrenceCalculator.m +++ b/SOPE/NGCards/iCalWeeklyRecurrenceCalculator.m @@ -119,10 +119,10 @@ [currentStartDate autorelease]; ranges = [NSMutableArray array]; count = 0; - i = [currentStartDate dayOfWeek]; // Set the first day of the week as Sunday and ignore WKST if (dayMask == nil) { + i = 0; while ([currentStartDate compare: endDate] == NSOrderedAscending || [currentStartDate compare: endDate] == NSOrderedSame) { @@ -147,6 +147,7 @@ { NGCalendarDateRange *r; + i = [currentStartDate dayOfWeek]; // Set the first day of the week as Sunday and ignore WKST while ([currentStartDate compare: endDate] == NSOrderedAscending || [currentStartDate compare: endDate] == NSOrderedSame) { @@ -175,7 +176,7 @@ if (isRecurrence) { - count++; + count++; if (repeatCount > 0 && count > repeatCount) break; currentEndDate = [currentStartDate addTimeInterval: [firstRange duration]];