From 51e4e4046d68219e9927138e8a42d4176fe20e17 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 4 Oct 2006 23:13:09 +0000 Subject: [PATCH] Monotone-Parent: dd288587ff94f2fc40c82dd8e32cf52f45b50841 Monotone-Revision: b0ba815a88a1243ad497187fab3660f3ebef9f27 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-10-04T23:13:09 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 3 ++ UI/SOGoUI/UIxComponent.h | 3 +- UI/SOGoUI/UIxComponent.m | 85 +++------------------------------------- 3 files changed, 10 insertions(+), 81 deletions(-) diff --git a/ChangeLog b/ChangeLog index e77d6da1b..0625b2e65 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2006-10-04 Wolfgang Sourdeau + * UI/SOGoUI/UIxComponent.m ([UIxComponent -selectedDate]): call + new methods from the NSCalendarDate methods. + * SoObjects/SOGo/NSCalendarDate+SOGo.m: module replacing and extending UI/Scheduler/NSCalendarDate+Scheduler.m. ([NSCalendarDate diff --git a/UI/SOGoUI/UIxComponent.h b/UI/SOGoUI/UIxComponent.h index c30d43432..87edb9836 100644 --- a/UI/SOGoUI/UIxComponent.h +++ b/UI/SOGoUI/UIxComponent.h @@ -64,7 +64,8 @@ - (NSString *)relativePathToUserFolderSubPath:(NSString *)_sub; /* date selection */ -- (NSCalendarDate *)selectedDate; +- (NSCalendarDate *) selectedDate; + - (NSString *)dateStringForDate:(NSCalendarDate *)_date; - (BOOL) hideFrame; diff --git a/UI/SOGoUI/UIxComponent.m b/UI/SOGoUI/UIxComponent.m index 9e4870c69..a78424aa4 100644 --- a/UI/SOGoUI/UIxComponent.m +++ b/UI/SOGoUI/UIxComponent.m @@ -30,6 +30,7 @@ #import #import #import +#import #import "UIxComponent.h" @@ -370,93 +371,17 @@ static BOOL uixDebugEnabled = NO; return rel; } -/* date */ -- (NSCalendarDate *) _cDateFromShortDateString: (NSString *) dateString - andShortTimeString: (NSString *) timeString -{ - unsigned int year, month, day, hour, minute, total; - NSCalendarDate *cDate, *tmpDate; - NSTimeZone *uTZ; - - uTZ = [[self clientObject] userTimeZone]; - - if (dateString && [dateString length] == 8) - { - total = [dateString intValue]; - year = total / 10000; - total -= year * 10000; - month = total / 100; - day = total - (month * 100); - } - else - { - tmpDate = [NSCalendarDate calendarDate]; - [tmpDate setTimeZone: uTZ]; - - year = [tmpDate yearOfCommonEra]; - month = [tmpDate monthOfYear]; - day = [tmpDate dayOfMonth]; - } - - if (timeString && [timeString length] == 4) - { - total = [timeString intValue]; - hour = total / 100; - minute = total = (hour * 100); - } - else - { - hour = 12; - minute = 0; - } - - cDate = [NSCalendarDate dateWithYear: year month: month day: day - hour: hour minute: minute second: 0 - timeZone: uTZ]; - - return cDate; -} - - (NSCalendarDate *) selectedDate { if (!_selectedDate) { _selectedDate - = [self _cDateFromShortDateString: [self queryParameterForKey: @"day"] - andShortTimeString: [self queryParameterForKey: @"hm"]]; + = [NSCalendarDate + dateFromShortDateString: [self queryParameterForKey: @"day"] + andShortTimeString: [self queryParameterForKey: @"hm"] + inTimeZone: [[self clientObject] userTimeZone]]; [_selectedDate retain]; } -// s = [self queryParameterForKey: @"day"]; - -// NSLog (@"query value 'day' = '%@'", s); -// if ([s length] > 0) -// dateString = [s stringByAppendingFormat: @" %@", -// [[[self clientObject] userTimeZone] abbreviation]]; -// else -// { -// cdate = [NSCalendarDate calendarDate]; -// dateString = [NSString stringWithFormat: @"%.4d%.2d%.2d %@", -// [cdate yearOfCommonEra], -// [cdate monthOfYear], -// [cdate dayOfMonth], -// [[[self clientObject] userTimeZone] abbreviation]]; -// } - -// cdate = [NSCalendarDate dateWithString: dateString -// calendarFormat: @"%Y%m%d %Z"]; -// s = [self queryParameterForKey: @"hm"]; -// NSLog (@"query value 'hm' = '%@'", s); -// if ([s length] == 4) -// { -// hour = [[s substringToIndex: 2] unsignedIntValue]; -// minute = [[s substringFromIndex: 2] unsignedIntValue]; -// _selectedDate = [cdate hour: hour minute: minute]; -// } -// else -// _selectedDate = [cdate hour: 12 minute: 0]; - -// [_selectedDate retain]; -// } return _selectedDate; }