diff --git a/SOPE/NGCards/ChangeLog b/SOPE/NGCards/ChangeLog index d789a1376..2445bcb24 100644 --- a/SOPE/NGCards/ChangeLog +++ b/SOPE/NGCards/ChangeLog @@ -1,3 +1,9 @@ +2008-07-03 Wolfgang Sourdeau + + * iCalEvent.m ([iCalEvent -endDate]): if no DTEND is specified, + returns the end date based on the start date and take the duration + into account if it is specified. + 2008-06-30 Wolfgang Sourdeau * iCalFreeBusy.m ([iCalFreeBusy diff --git a/SOPE/NGCards/iCalEvent.m b/SOPE/NGCards/iCalEvent.m index d3f10f22d..5e766d230 100644 --- a/SOPE/NGCards/iCalEvent.m +++ b/SOPE/NGCards/iCalEvent.m @@ -68,8 +68,21 @@ - (NSCalendarDate *) endDate { - return [(iCalDateTime *) [self uniqueChildWithTag: @"dtend"] - dateTime]; + NSCalendarDate *endDate; + NSString *duration; + + endDate = [(iCalDateTime *) [self uniqueChildWithTag: @"dtend"] + dateTime]; + if (!endDate) + { + endDate = [self startDate]; + duration = [self duration]; + if ([duration length]) + endDate + = [endDate addTimeInterval: [duration durationAsTimeInterval]]; + } + + return endDate; } - (BOOL) hasEndDate