From 665d11976afdf99115b1ee227f38fb47a8f32144 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Fri, 31 Aug 2012 20:31:33 +0000 Subject: [PATCH] See ChangeLog Monotone-Parent: 749811709acadced020a19e4ce7c00f07ac86e77 Monotone-Revision: 635c9e7117554059bb6df5357a9f71f448867b55 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2012-08-31T20:31:33 --- SOPE/NGCards/ChangeLog | 6 ++++++ SOPE/NGCards/iCalWeeklyRecurrenceCalculator.m | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) 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]];