Monotone-Parent: b6726f7b87c51426fc4fa2e3ed33d20cb47a89e0
Monotone-Revision: f638868d7db65b1617476f06e76394a24bca8310 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2011-01-14T19:07:43 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
db851140d4
commit
ab94153bfc
|
@ -178,19 +178,24 @@
|
|||
NSString *dateString;
|
||||
unsigned i;
|
||||
|
||||
dates = [NSMutableArray array];
|
||||
dateList = [[self childrenWithTag: @"exdate"] objectEnumerator];
|
||||
|
||||
while ((dateString = [dateList nextObject]))
|
||||
if (theTimeZone)
|
||||
{
|
||||
exDates = [(iCalDateTime*) dateString values];
|
||||
for (i = 0; i < [exDates count]; i++)
|
||||
dates = [NSMutableArray array];
|
||||
dateList = [[self childrenWithTag: @"exdate"] objectEnumerator];
|
||||
|
||||
while ((dateString = [dateList nextObject]))
|
||||
{
|
||||
dateString = [exDates objectAtIndex: i];
|
||||
exDate = [theTimeZone computedDateForString: dateString];
|
||||
[dates addObject: exDate];
|
||||
exDates = [(iCalDateTime*) dateString values];
|
||||
for (i = 0; i < [exDates count]; i++)
|
||||
{
|
||||
dateString = [exDates objectAtIndex: i];
|
||||
exDate = [theTimeZone computedDateForString: dateString];
|
||||
[dates addObject: exDate];
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
dates = [self exceptionDates];
|
||||
|
||||
return dates;
|
||||
}
|
||||
|
|
|
@ -835,7 +835,6 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
|
|||
NSMutableDictionary *row, *fixedRow;
|
||||
NSMutableArray *records;
|
||||
NSDictionary *cycleinfo;
|
||||
NSCalendarDate *startDate, *endDate;
|
||||
NGCalendarDateRange *firstRange, *oneRange;
|
||||
NSArray *rules, *exRules, *exDates, *ranges;
|
||||
NSArray *elements, *components;
|
||||
|
@ -864,14 +863,14 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
|
|||
theRecord];
|
||||
return;
|
||||
}
|
||||
rules = [cycleinfo objectForKey: @"rules"];
|
||||
exRules = [cycleinfo objectForKey: @"exRules"];
|
||||
exDates = [cycleinfo objectForKey: @"exDates"];
|
||||
|
||||
row = [self fixupRecord: theRecord];
|
||||
[row removeObjectForKey: @"c_cycleinfo"];
|
||||
[row setObject: sharedYes forKey: @"isRecurrentEvent"];
|
||||
|
||||
startDate = [row objectForKey: @"startDate"];
|
||||
endDate = [row objectForKey: @"endDate"];
|
||||
|
||||
content = [theRecord objectForKey: @"c_content"];
|
||||
if ([content length])
|
||||
{
|
||||
|
@ -886,20 +885,20 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
|
|||
firstStartDate = (iCalDateTime*)[component uniqueChildWithTag: @"dtstart"];
|
||||
firstEndDate = (iCalDateTime*)[component uniqueChildWithTag: @"dtend"];
|
||||
eventTimeZone = [firstStartDate timeZone];
|
||||
startDate = [eventTimeZone computedDateForDate: startDate];
|
||||
firstRange = [NGCalendarDateRange calendarDateRangeWithStartDate: [[[firstStartDate values] lastObject] asCalendarDate]
|
||||
endDate: [[[firstEndDate values] lastObject] asCalendarDate]];
|
||||
|
||||
// Adjust the range to check with respect to the event timezone (extracted from the start date)
|
||||
checkStartDate = [eventTimeZone computedDateForDate: [theRange startDate]];
|
||||
checkEndDate = [eventTimeZone computedDateForDate: [theRange endDate]];
|
||||
theRange = [NGCalendarDateRange calendarDateRangeWithStartDate: checkStartDate
|
||||
endDate: checkEndDate];
|
||||
|
||||
if (eventTimeZone)
|
||||
{
|
||||
// Adjust the range to check with respect to the event timezone (extracted from the start date)
|
||||
checkStartDate = [eventTimeZone computedDateForDate: [theRange startDate]];
|
||||
checkEndDate = [eventTimeZone computedDateForDate: [theRange endDate]];
|
||||
theRange = [NGCalendarDateRange calendarDateRangeWithStartDate: checkStartDate
|
||||
endDate: checkEndDate];
|
||||
exDates = [eventTimeZone computedDatesForStrings: exDates];
|
||||
}
|
||||
|
||||
// Calculate the occurrences for the given range
|
||||
rules = [cycleinfo objectForKey: @"rules"];
|
||||
exRules = [cycleinfo objectForKey: @"exRules"];
|
||||
exDates = [eventTimeZone computedDatesForStrings: [cycleinfo objectForKey: @"exDates"]];
|
||||
ranges = [iCalRecurrenceCalculator recurrenceRangesWithinCalendarDateRange: theRange
|
||||
firstInstanceCalendarDateRange: firstRange
|
||||
recurrenceRules: rules
|
||||
|
|
|
@ -130,7 +130,10 @@
|
|||
// Set the range to check with respect to the event timezone (extracted from the start date)
|
||||
firstStartDate = (iCalDateTime *)[self uniqueChildWithTag: @"dtstart"];
|
||||
eventTimeZone = [firstStartDate timeZone];
|
||||
startDate = [eventTimeZone computedDateForDate: theOccurenceDate];
|
||||
if (eventTimeZone)
|
||||
startDate = [eventTimeZone computedDateForDate: theOccurenceDate];
|
||||
else
|
||||
startDate = theOccurenceDate;
|
||||
endDate = [startDate addTimeInterval: [self occurenceInterval]];
|
||||
checkRange = [NGCalendarDateRange calendarDateRangeWithStartDate: startDate
|
||||
endDate: endDate];
|
||||
|
|
Loading…
Reference in New Issue