Monotone-Parent: d85d7d8fee328504d17e9458ec53c9819d09b3bc
Monotone-Revision: bc0e93dcef9a5cd587d3be1a69b22cdf040ed789

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2008-12-12T18:43:14
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Francis Lachapelle 2008-12-12 18:43:14 +00:00
parent 376a681d94
commit ee3c7fe50f
5 changed files with 10 additions and 7 deletions

View File

@ -138,7 +138,7 @@
lastInstanceStartDate = [firStart dateByAddingYears: 0 months: 0 lastInstanceStartDate = [firStart dateByAddingYears: 0 months: 0
days: ([rrule repeatInterval] days: ([rrule repeatInterval]
* [rrule repeatCount])]; * ([rrule repeatCount] - 1))];
} }
else else
lastInstanceStartDate = [super lastInstanceStartDate]; lastInstanceStartDate = [super lastInstanceStartDate];

View File

@ -494,7 +494,7 @@ static void NGMonthDaySet_fillWithByDayX (NGMonthDaySet *daySet,
lastInstanceStartDate = [firStart dateByAddingYears: 0 lastInstanceStartDate = [firStart dateByAddingYears: 0
months: ([rrule repeatInterval] months: ([rrule repeatInterval]
* [rrule repeatCount]) * ([rrule repeatCount] - 1))
days: 0]; days: 0];
} }
else else

View File

@ -195,7 +195,7 @@
lastInstanceStartDate = [firStart dateByAddingYears: 0 months: 0 lastInstanceStartDate = [firStart dateByAddingYears: 0 months: 0
days: (7 * [rrule repeatInterval] days: (7 * [rrule repeatInterval]
* [rrule repeatCount])]; * ([rrule repeatCount] - 1))];
} }
else else
lastInstanceStartDate = [super lastInstanceStartDate]; lastInstanceStartDate = [super lastInstanceStartDate];

View File

@ -98,7 +98,7 @@
lastInstanceStartDate lastInstanceStartDate
= [firStart dateByAddingYears: ([rrule repeatInterval] = [firStart dateByAddingYears: ([rrule repeatInterval]
* [rrule repeatCount]) * ([rrule repeatCount] - 1))
months: 0 months: 0
days: 0]; days: 0];
} }

View File

@ -40,15 +40,18 @@
- (BOOL) isStillRelevant - (BOOL) isStillRelevant
{ {
NSCalendarDate *now; NSCalendarDate *now, *lastRecurrence;
BOOL isStillRelevent; BOOL isStillRelevent;
now = [NSCalendarDate calendarDate]; now = [NSCalendarDate calendarDate];
if ([self isRecurrent]) if ([self isRecurrent])
isStillRelevent = ([[self lastPossibleRecurrenceStartDate] earlierDate: now] == now); {
lastRecurrence = [self lastPossibleRecurrenceStartDate];
isStillRelevent = (lastRecurrence == nil || [lastRecurrence earlierDate: now] == now);
}
else else
isStillRelevent = ([[self endDate] earlierDate: now] == now); isStillRelevent = ([[self endDate] earlierDate: now] == now);
return isStillRelevent; return isStillRelevent;
} }