See ChangeLog.
Monotone-Parent: 4a37382e84f4a00ccbbc0542ef0ae4a99a954cdd Monotone-Revision: 5768aec2a733241a4cb94db69e98b57603adb638 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2011-03-29T23:22:08 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
cb76677762
commit
eea9b8b91d
|
@ -1,3 +1,13 @@
|
||||||
|
2011-03-29 Francis Lachapelle <flachapelle@inverse.ca>
|
||||||
|
|
||||||
|
* iCalRepeatableEntityObject.m (-rules:withEventTimeZone:): new
|
||||||
|
method that returns a new set of rules with their "untill dates"
|
||||||
|
adjusted to the specified timezone.
|
||||||
|
(-recurrenceRulesWithTimeZone:): new method that returns the
|
||||||
|
recurrence rules adjusted to the specified timezone.
|
||||||
|
(-exceptionRulesWithTimeZone:): new method that returns the
|
||||||
|
exception rules adjusted to the specified timezone.
|
||||||
|
|
||||||
2011-03-23 Francis Lachapelle <flachapelle@inverse.ca>
|
2011-03-23 Francis Lachapelle <flachapelle@inverse.ca>
|
||||||
|
|
||||||
* iCalRepeatableEntityObject.m (-removeAllExceptionDates): don't
|
* iCalRepeatableEntityObject.m (-removeAllExceptionDates): don't
|
||||||
|
|
|
@ -47,17 +47,21 @@
|
||||||
- (void)setRecurrenceRules:(NSArray *)_rrule;
|
- (void)setRecurrenceRules:(NSArray *)_rrule;
|
||||||
- (BOOL)hasRecurrenceRules;
|
- (BOOL)hasRecurrenceRules;
|
||||||
- (NSArray *)recurrenceRules;
|
- (NSArray *)recurrenceRules;
|
||||||
|
- (NSArray *)recurrenceRulesWithTimeZone: (iCalTimeZone *) timezone;
|
||||||
|
|
||||||
- (void)removeAllExceptionRules;
|
- (void)removeAllExceptionRules;
|
||||||
- (void)addToExceptionRules:(id)_rrule;
|
- (void)addToExceptionRules:(id)_rrule;
|
||||||
- (BOOL)hasExceptionRules;
|
- (BOOL)hasExceptionRules;
|
||||||
- (NSArray *)exceptionRules;
|
- (NSArray *)exceptionRules;
|
||||||
|
- (NSArray *)exceptionRulesWithTimeZone: (iCalTimeZone *) timezone;
|
||||||
|
|
||||||
- (void)removeAllExceptionDates;
|
- (void)removeAllExceptionDates;
|
||||||
- (void)addToExceptionDates:(NSCalendarDate *)_date;
|
- (void)addToExceptionDates:(NSCalendarDate *)_date;
|
||||||
- (BOOL)hasExceptionDates;
|
- (BOOL)hasExceptionDates;
|
||||||
- (NSArray *)exceptionDates;
|
- (NSArray *)exceptionDates;
|
||||||
- (NSArray *)exceptionDatesWithEventTimeZone:(iCalTimeZone*)theTimeZone;
|
- (NSArray *)exceptionDatesWithTimeZone: (iCalTimeZone*) theTimeZone;
|
||||||
|
|
||||||
|
- (NSArray *) rules: (NSArray *) theRules withTimeZone: (iCalTimeZone *) theTimeZone;
|
||||||
|
|
||||||
- (BOOL)isRecurrent;
|
- (BOOL)isRecurrent;
|
||||||
- (BOOL)isWithinCalendarDateRange:(NGCalendarDateRange *)_range
|
- (BOOL)isWithinCalendarDateRange:(NGCalendarDateRange *)_range
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2004-2005 SKYRIX Software AG
|
Copyright (C) 2004-2005 SKYRIX Software AG
|
||||||
Copyright (C) 2010 Inverse inc.
|
Copyright (C) 2011 Inverse inc.
|
||||||
|
|
||||||
This file is part of SOPE.
|
This file is part of SOPE.
|
||||||
|
|
||||||
|
@ -78,6 +78,14 @@
|
||||||
return [self childrenWithTag: @"rrule"];
|
return [self childrenWithTag: @"rrule"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSArray *) recurrenceRulesWithTimeZone: (iCalTimeZone *) timezone
|
||||||
|
{
|
||||||
|
NSArray *rules;
|
||||||
|
|
||||||
|
rules = [self recurrenceRules];
|
||||||
|
return [self rules: rules withTimeZone: timezone];
|
||||||
|
}
|
||||||
|
|
||||||
- (void) removeAllExceptionRules
|
- (void) removeAllExceptionRules
|
||||||
{
|
{
|
||||||
[self removeChildren: [self exceptionRules]];
|
[self removeChildren: [self exceptionRules]];
|
||||||
|
@ -104,6 +112,57 @@
|
||||||
return [self childrenWithTag: @"exrule"];
|
return [self childrenWithTag: @"exrule"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSArray *) exceptionRulesWithTimeZone: (iCalTimeZone *) timezone
|
||||||
|
{
|
||||||
|
NSArray *rules;
|
||||||
|
|
||||||
|
rules = [self exceptionRules];
|
||||||
|
return [self rules: rules withTimeZone: timezone];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a new set of rules, but with "until dates" adjusted to the
|
||||||
|
* specified timezone.
|
||||||
|
* Used when calculating a recurrence/exception rule.
|
||||||
|
* @param theRules the iCalRecurrenceRule instances
|
||||||
|
* @param theTimeZone the timezone of the entity.
|
||||||
|
* @see recurrenceRulesWithTimeZone:
|
||||||
|
* @see exceptionRulesWithTimeZone:
|
||||||
|
* @return a new array of iCalRecurrenceRule instances, adjusted for the timezone.
|
||||||
|
*/
|
||||||
|
- (NSArray *) rules: (NSArray *) theRules withTimeZone: (iCalTimeZone *) theTimeZone
|
||||||
|
{
|
||||||
|
NSArray *rules;
|
||||||
|
NSCalendarDate *untilDate;
|
||||||
|
NSMutableArray *fixedRules;
|
||||||
|
iCalRecurrenceRule *currentRule;
|
||||||
|
unsigned int max, count;
|
||||||
|
|
||||||
|
rules = theRules;
|
||||||
|
if (theTimeZone)
|
||||||
|
{
|
||||||
|
max = [rules count];
|
||||||
|
if (max)
|
||||||
|
{
|
||||||
|
fixedRules = [NSMutableArray arrayWithCapacity: max];
|
||||||
|
for (count = 0; count < max; count++)
|
||||||
|
{
|
||||||
|
currentRule = [rules objectAtIndex: count];
|
||||||
|
untilDate = [currentRule untilDate];
|
||||||
|
if (untilDate)
|
||||||
|
{
|
||||||
|
untilDate = [theTimeZone computedDateForDate: untilDate];
|
||||||
|
[currentRule setUntilDate: untilDate];
|
||||||
|
}
|
||||||
|
[fixedRules addObject: currentRule];
|
||||||
|
}
|
||||||
|
rules = fixedRules;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return rules;
|
||||||
|
}
|
||||||
|
|
||||||
- (void) removeAllExceptionDates
|
- (void) removeAllExceptionDates
|
||||||
{
|
{
|
||||||
[self removeChildren: [self childrenWithTag: @"exdate"]];
|
[self removeChildren: [self childrenWithTag: @"exdate"]];
|
||||||
|
@ -163,13 +222,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the exception dates for the event, but adjusted to the event timezone.
|
* Returns the exception dates for the entity, but adjusted to the entity timezone.
|
||||||
* Used when calculating a recurrence rule.
|
* Used when calculating a recurrence rule.
|
||||||
* @param theTimeZone the timezone of the event.
|
* @param theTimeZone the timezone of the entity.
|
||||||
* @see [iCalTimeZone computedDatesForStrings:]
|
* @see [iCalTimeZone computedDatesForStrings:]
|
||||||
* @return the exception dates for the event, adjusted to the event timezone.
|
* @return the exception dates, adjusted to the timezone.
|
||||||
*/
|
*/
|
||||||
- (NSArray *) exceptionDatesWithEventTimeZone: (iCalTimeZone *) theTimeZone
|
- (NSArray *) exceptionDatesWithTimeZone: (iCalTimeZone *) theTimeZone
|
||||||
{
|
{
|
||||||
NSArray *dates, *exDates;
|
NSArray *dates, *exDates;
|
||||||
NSEnumerator *dateList;
|
NSEnumerator *dateList;
|
||||||
|
|
Loading…
Reference in New Issue