Check range before adding single occurrences
parent
70dbba877a
commit
9d45d57cb2
|
@ -1238,11 +1238,24 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
|
|||
// contains ONLY one or more vevent with recurrence-id set for each of them. This can happen if
|
||||
// an organizer invites an attendee only to one or many occurences of a repetitive event.
|
||||
iCalCalendar *c;
|
||||
NSDictionary *record;
|
||||
|
||||
c = [iCalCalendar parseSingleFromSource: [theRecord objectForKey: @"c_content"]];
|
||||
[theRecords addObjectsFromArray: [self _fixupRecords: [c quickRecordsFromContent: [theRecord objectForKey: @"c_content"]
|
||||
components = [self _fixupRecords:
|
||||
[c quickRecordsFromContent: [theRecord objectForKey: @"c_content"]
|
||||
container: nil
|
||||
nameInContainer: [theRecord objectForKey: @"c_name"]]]];
|
||||
nameInContainer: [theRecord objectForKey: @"c_name"]]];
|
||||
max = [components count];
|
||||
for (count = 0; count < max; count++)
|
||||
{
|
||||
record = [components objectAtIndex: count];
|
||||
oneRange = [NGCalendarDateRange calendarDateRangeWithStartDate: [record objectForKey: @"startDate"]
|
||||
endDate: [record objectForKey: @"endDate"]];
|
||||
if ([theRange doesIntersectWithDateRange: oneRange])
|
||||
{
|
||||
[theRecords addObject: record];
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -31,6 +31,9 @@
|
|||
|
||||
- (iCalEvent *) eventWithRecurrenceID: (NSString *) recID;
|
||||
- (iCalToDo *) todoWithRecurrenceID: (NSString *) recID;
|
||||
- (NSArray *) quickRecordsFromContent: (NSString *) theContent
|
||||
container: (id) theContainer
|
||||
nameInContainer: (NSString *) nameInContainer;
|
||||
|
||||
@end
|
||||
|
||||
|
|
Loading…
Reference in New Issue