See Changelog.

Monotone-Parent: f632b73418c67ba2778ff41a75a2842d90da9883
Monotone-Revision: 8ae1b0b4d89d23b2996f0b95677ca5599649f47b

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2011-01-14T15:33:20
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2011-01-14 15:33:20 +00:00
parent 32dc764c41
commit 2c8744dcb0
8 changed files with 110 additions and 3 deletions
+38
View File
@@ -29,6 +29,7 @@
#import "NSCalendarDate+NGCards.h"
#import "iCalDateTime.h"
#import "iCalTimeZone.h"
#import "iCalRecurrenceRule.h"
#import "iCalRecurrenceCalculator.h"
#import "iCalRepeatableEntityObject.h"
@@ -130,6 +131,10 @@
return ([[self childrenWithTag: @"exdate"] count] > 0);
}
/**
* Return the exception dates of the event in GMT.
* @return an array of strings.
*/
- (NSArray *) exceptionDates
{
NSArray *exDates;
@@ -157,6 +162,39 @@
return dates;
}
/**
* Returns the exception dates for the event, but adjusted to the event timezone.
* Used when calculating a recurrence rule.
* @param theTimeZone the timezone of the event.
* @see [iCalTimeZone computedDatesForStrings:]
* @return the exception dates for the event, adjusted to the event timezone.
*/
- (NSArray *) exceptionDatesWithEventTimeZone: (iCalTimeZone *) theTimeZone
{
NSArray *exDates;
NSMutableArray *dates;
NSEnumerator *dateList;
NSCalendarDate *exDate;
NSString *dateString;
unsigned i;
dates = [NSMutableArray array];
dateList = [[self childrenWithTag: @"exdate"] objectEnumerator];
while ((dateString = [dateList nextObject]))
{
exDates = [(iCalDateTime*) dateString values];
for (i = 0; i < [exDates count]; i++)
{
dateString = [exDates objectAtIndex: i];
exDate = [theTimeZone computedDateForString: dateString];
[dates addObject: exDate];
}
}
return dates;
}
/* Convenience */
- (BOOL) isRecurrent