diff --git a/SOPE/NGCards/ChangeLog b/SOPE/NGCards/ChangeLog index 3263427f1..d789a1376 100644 --- a/SOPE/NGCards/ChangeLog +++ b/SOPE/NGCards/ChangeLog @@ -1,3 +1,9 @@ +2008-06-30 Wolfgang Sourdeau + + * iCalFreeBusy.m ([iCalFreeBusy + -fillStartDate:startDateandEndDate:endDate]): new method created + to avoid enlarging the code. + 2008-04-02 Wolfgang Sourdeau * iCalRecurrenceCalculator.m ([iCalRecurrenceCalculator diff --git a/SOPE/NGCards/iCalFreeBusy.h b/SOPE/NGCards/iCalFreeBusy.h index 8e744025f..d5ac71275 100644 --- a/SOPE/NGCards/iCalFreeBusy.h +++ b/SOPE/NGCards/iCalFreeBusy.h @@ -43,6 +43,9 @@ typedef enum iCalFreeBusyType - (NSCalendarDate *) endDate; - (BOOL) hasEndDate; +- (void) fillStartDate: (NSCalendarDate **) startDate + andEndDate: (NSCalendarDate **) endDate; + - (void) addFreeBusyFrom: (NSCalendarDate *) start to: (NSCalendarDate *) end type: (iCalFreeBusyType) type; diff --git a/SOPE/NGCards/iCalFreeBusy.m b/SOPE/NGCards/iCalFreeBusy.m index 17fd8e41d..74b25a2c1 100644 --- a/SOPE/NGCards/iCalFreeBusy.m +++ b/SOPE/NGCards/iCalFreeBusy.m @@ -62,6 +62,20 @@ return ([[self childrenWithTag: @"dtend"] count] > 0); } +- (void) fillStartDate: (NSCalendarDate **) startDate + andEndDate: (NSCalendarDate **) endDate +{ + if ([self hasStartDate]) + *startDate = [self startDate]; + else + *startDate = nil; + + if ([self hasEndDate]) + *endDate = [self endDate]; + else + *endDate = nil; +} + - (NSString *) _freeBusyTypeString: (iCalFreeBusyType) type { NSString *typeString;