Monotone-Parent: 3330b71df0d8c44d51c1026cc042cc4c911cff1a

Monotone-Revision: 06ef0619c58e045dce76e8be407e26af13e75aeb

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-06-07T16:24:20
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2007-06-07 16:24:20 +00:00
parent f58ab98f0d
commit a17ccf74c3
3 changed files with 31 additions and 4 deletions

View File

@ -1,5 +1,10 @@
2007-06-07 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* iCalDateTime.m ([iCalDateTime -setDate:dateTime]): take the date
passed as parameter as an all day date.
([iCalDateTime -isAllDay]): new method determining whether the
current value is an all day value.
* NSString+NGCards.m ([NSString -isAllDayDate]): new method that
determines whether the date represented in "self" is an all day
date (date only) or not (date + time).

View File

@ -33,9 +33,12 @@
- (void) setTimeZone: (iCalTimeZone *) iTZ;
- (iCalTimeZone *) timeZone;
- (void) setDate: (NSCalendarDate *) date;
- (void) setDateTime: (NSCalendarDate *) dateTime;
- (NSCalendarDate *) dateTime;
- (BOOL) isAllDay;
@end
#endif /* ICALDATETIMEELEMENT_H */

View File

@ -89,11 +89,12 @@
/* TODO: should implement the case where the TZ would be implicitly local
(no TZID and no UTC) */
- (void) setDateTime: (NSCalendarDate *) dateTime
- (void) _setDateTime: (NSCalendarDate *) dateTime
forAllDayEntity: (BOOL) forAllDayEntity
{
NSCalendarDate *tmpTime;
NSTimeZone *utcTZ;
NSString *timeString;
NSString *timeString, *fmtTimeString;
iCalTimeZone *tz;
if (dateTime)
@ -107,8 +108,11 @@
tmpTime = [dateTime copy];
[tmpTime setTimeZone: utcTZ];
timeString = [NSString stringWithFormat: @"%@Z",
[tmpTime iCalFormattedDateTimeString]];
if (forAllDayEntity)
fmtTimeString = [tmpTime iCalFormattedDateTimeString];
else
fmtTimeString = [tmpTime iCalFormattedDateString];
timeString = [NSString stringWithFormat: @"%@Z", fmtTimeString];
[tmpTime release];
}
}
@ -118,6 +122,16 @@
[self setValue: 0 to: timeString];
}
- (void) setDateTime: (NSCalendarDate *) dateTime
{
[self _setDateTime: dateTime forAllDayEntity: NO];
}
- (void) setDate: (NSCalendarDate *) dateTime
{
[self _setDateTime: dateTime forAllDayEntity: YES];
}
- (NSCalendarDate *) dateTime
{
iCalTimeZone *iTZ;
@ -152,4 +166,9 @@
return dateTime;
}
- (BOOL) isAllDay
{
return [[self value: 0] isAllDayDate];
}
@end