From 29828b6f55f7628298eaf35dddb323c7e26ee8a6 Mon Sep 17 00:00:00 2001 From: wolfgang Date: Wed, 13 Jun 2007 02:34:44 +0000 Subject: [PATCH] git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1082 d1b88da0-ebda-0310-925b-ed51d893ca5b --- SOPE/NGCards/ChangeLog | 10 ++++++++++ SOPE/NGCards/iCalDateTime.m | 7 ++++++- SOPE/NGCards/iCalTimeZone.h | 1 + SOPE/NGCards/iCalTimeZone.m | 22 ++++++++++++++++------ 4 files changed, 33 insertions(+), 7 deletions(-) diff --git a/SOPE/NGCards/ChangeLog b/SOPE/NGCards/ChangeLog index fa126515..0c04752c 100644 --- a/SOPE/NGCards/ChangeLog +++ b/SOPE/NGCards/ChangeLog @@ -1,3 +1,13 @@ +2007-06-12 Wolfgang Sourdeau + + * iCalDateTime.m ([iCalDateTime + -_setDateTime:dateTimeforAllDayEntity:forAllDayEntity]): take the + forAllDayEntity parameter into account when the date entity has a + timezone. + + * iCalTimeZone.m ([iCalTimeZone -dateStringForDate:date]): new + method that returns dates formatted for all day events. + 2007-06-07 Wolfgang Sourdeau * iCalDateTime.m ([iCalDateTime diff --git a/SOPE/NGCards/iCalDateTime.m b/SOPE/NGCards/iCalDateTime.m index fc707b32..127be961 100644 --- a/SOPE/NGCards/iCalDateTime.m +++ b/SOPE/NGCards/iCalDateTime.m @@ -101,7 +101,12 @@ { tz = [self timeZone]; if (tz) - timeString = [tz dateTimeStringForDate: dateTime]; + { + if (forAllDayEntity) + timeString = [tz dateStringForDate: dateTime]; + else + timeString = [tz dateTimeStringForDate: dateTime]; + } else { utcTZ = [NSTimeZone timeZoneWithName: @"GMT"]; diff --git a/SOPE/NGCards/iCalTimeZone.h b/SOPE/NGCards/iCalTimeZone.h index ba621184..10ce4db6 100644 --- a/SOPE/NGCards/iCalTimeZone.h +++ b/SOPE/NGCards/iCalTimeZone.h @@ -32,6 +32,7 @@ - (NSString *) tzId; - (NSString *) dateTimeStringForDate: (NSCalendarDate *) date; +- (NSString *) dateStringForDate: (NSCalendarDate *) date; - (NSCalendarDate *) dateForDateTimeString: (NSString *) string; @end diff --git a/SOPE/NGCards/iCalTimeZone.m b/SOPE/NGCards/iCalTimeZone.m index 1de139fb..0e2e56be 100644 --- a/SOPE/NGCards/iCalTimeZone.m +++ b/SOPE/NGCards/iCalTimeZone.m @@ -100,7 +100,7 @@ return period; } -- (NSString *) dateTimeStringForDate: (NSCalendarDate *) date +- (NSCalendarDate *) _computedDateTimeForDate: (NSCalendarDate *) date { NSCalendarDate *tmpDate; NSTimeZone *utc; @@ -109,12 +109,22 @@ tmpDate = [date copy]; [tmpDate autorelease]; [tmpDate setTimeZone: utc]; - tmpDate - = [tmpDate addYear: 0 month: 0 day: 0 - hour: 0 minute: 0 - second: [[self periodForDate: date] secondsOffsetFromGMT]]; - return [tmpDate iCalFormattedDateTimeString]; + return [tmpDate addYear: 0 month: 0 day: 0 + hour: 0 minute: 0 + second: [[self periodForDate: date] secondsOffsetFromGMT]]; +} + +- (NSString *) dateTimeStringForDate: (NSCalendarDate *) date +{ + return [[self _computedDateTimeForDate: date] + iCalFormattedDateTimeString]; +} + +- (NSString *) dateStringForDate: (NSCalendarDate *) date +{ + return [[self _computedDateTimeForDate: date] + iCalFormattedDateString]; } - (NSCalendarDate *) dateForDateTimeString: (NSString *) string -- 2.39.5