From 52b9643f436f66d18f68c80ea849c7407a6335f0 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 13 Jun 2007 02:34:29 +0000 Subject: [PATCH] Monotone-Parent: c7fdfee7f222580acc0dcab2c03bab46e8f5f301 Monotone-Revision: 98210b359e6e3fe57ef302cfac263161a8f25967 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-06-13T02:34:29 Monotone-Branch: ca.inverse.sogo --- SOPE/NGCards/ChangeLog | 10 ++++++++++ SOPE/NGCards/iCalDateTime.m | 7 ++++++- SOPE/NGCards/iCalTimeZone.h | 1 + SOPE/NGCards/iCalTimeZone.m | 22 ++++++++++++++++------ UI/Scheduler/UIxCalView.h | 2 +- UI/Scheduler/UIxCalView.m | 2 +- 6 files changed, 35 insertions(+), 9 deletions(-) diff --git a/SOPE/NGCards/ChangeLog b/SOPE/NGCards/ChangeLog index fa1265156..0c04752c4 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 fc707b32f..127be961a 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 ba6211847..10ce4db6d 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 1de139fb6..0e2e56be4 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 diff --git a/UI/Scheduler/UIxCalView.h b/UI/Scheduler/UIxCalView.h index 6aa6ca243..b5c9d7fa7 100644 --- a/UI/Scheduler/UIxCalView.h +++ b/UI/Scheduler/UIxCalView.h @@ -1,4 +1,4 @@ -// $Id: UIxCalView.h 1045 2007-04-11 20:13:07Z wolfgang $ +// $Id: UIxCalView.h 1080 2007-06-12 22:15:47Z wolfgang $ #ifndef __SOGo_UIxCalView_H__ #define __SOGo_UIxCalView_H__ diff --git a/UI/Scheduler/UIxCalView.m b/UI/Scheduler/UIxCalView.m index 351a21b52..b808e61c7 100644 --- a/UI/Scheduler/UIxCalView.m +++ b/UI/Scheduler/UIxCalView.m @@ -1,4 +1,4 @@ -// $Id: UIxCalView.m 1052 2007-05-09 19:35:09Z wolfgang $ +// $Id: UIxCalView.m 1080 2007-06-12 22:15:47Z wolfgang $ #import "common.h" //#import