Monotone-Parent: dd288587ff94f2fc40c82dd8e32cf52f45b50841

Monotone-Revision: b0ba815a88a1243ad497187fab3660f3ebef9f27

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2006-10-04T23:13:09
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2006-10-04 23:13:09 +00:00
parent 198ca8e76e
commit 51e4e4046d
3 changed files with 10 additions and 81 deletions

View File

@@ -1,5 +1,8 @@
2006-10-04 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* 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

View File

@@ -64,7 +64,8 @@
- (NSString *)relativePathToUserFolderSubPath:(NSString *)_sub;
/* date selection */
- (NSCalendarDate *)selectedDate;
- (NSCalendarDate *) selectedDate;
- (NSString *)dateStringForDate:(NSCalendarDate *)_date;
- (BOOL) hideFrame;

View File

@@ -30,6 +30,7 @@
#import <SOGo/SOGoUser.h>
#import <SOGo/SOGoObject.h>
#import <SOGo/SOGoCustomGroupFolder.h>
#import <SOGo/NSCalendarDate+SOGo.h>
#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;
}