diff --git a/ChangeLog b/ChangeLog index 0625b2e65..edfc7016a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-10-05 Wolfgang Sourdeau + + * SoObjects/SOGo/NSCalendarDate+SOGo.m ([NSCalendarDate -adjustedDate]) + ([NSCalendarDate -driftedDate]): methods made useless by a better + comprehension of the NSTimeZone API... + 2006-10-04 Wolfgang Sourdeau * UI/SOGoUI/UIxComponent.m ([UIxComponent -selectedDate]): call diff --git a/SoObjects/SOGo/NSCalendarDate+SOGo.h b/SoObjects/SOGo/NSCalendarDate+SOGo.h index ec4c8f85f..84c2c66a7 100644 --- a/SoObjects/SOGo/NSCalendarDate+SOGo.h +++ b/SoObjects/SOGo/NSCalendarDate+SOGo.h @@ -33,10 +33,6 @@ andShortTimeString: (NSString *) timeString inTimeZone: (NSTimeZone *) timeZone; -/* a date tuned to its timezone when initialized with local values */ -- (NSCalendarDate *) adjustedDate; -- (NSCalendarDate *) driftedDate; - - (BOOL) isDateInSameMonth: (NSCalendarDate *) _other; - (NSCalendarDate *) dayOfWeeK: (unsigned) _day offsetFromSunday: (unsigned) _off; diff --git a/SoObjects/SOGo/NSCalendarDate+SOGo.m b/SoObjects/SOGo/NSCalendarDate+SOGo.m index 67fd8902c..a6160cadc 100644 --- a/SoObjects/SOGo/NSCalendarDate+SOGo.m +++ b/SoObjects/SOGo/NSCalendarDate+SOGo.m @@ -32,24 +32,6 @@ unsigned int year, month, day, hour, minute, total; NSCalendarDate *cDate, *tmpDate; - 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 = [tmpDate addYear: 0 month: 0 day: 0 hour: 0 minute: 0 - second: [timeZone secondsFromGMT]]; - year = [tmpDate yearOfCommonEra]; - month = [tmpDate monthOfYear]; - day = [tmpDate dayOfMonth]; - } - if (timeString && [timeString length] == 4) { total = [timeString intValue]; @@ -62,31 +44,29 @@ minute = 0; } - cDate = [self dateWithYear: year month: month day: day - hour: hour minute: minute second: 0 - timeZone: timeZone]; + if (dateString && [dateString length] == 8) + { + total = [dateString intValue]; + year = total / 10000; + total -= year * 10000; + month = total / 100; + day = total - (month * 100); + cDate = [self dateWithYear: year month: month day: day + hour: hour minute: minute second: 0 + timeZone: timeZone]; + } + else + { + tmpDate = [NSCalendarDate calendarDate]; + [tmpDate setTimeZone: timeZone]; + cDate = [self dateWithYear: [tmpDate yearOfCommonEra] + month: [tmpDate monthOfYear] + day: [tmpDate dayOfMonth] + hour: hour minute: minute second: 0 + timeZone: timeZone]; + } - return [cDate adjustedDate]; -} - -- (NSCalendarDate *) adjustedDate -{ - NSTimeZone *dTZ; - - dTZ = [self timeZone]; - - return [self addYear: 0 month: 0 day: 0 hour: 0 minute: 0 - second: -[dTZ secondsFromGMT]]; -} - -- (NSCalendarDate *) driftedDate -{ - NSTimeZone *dTZ; - - dTZ = [self timeZone]; - - return [self addYear: 0 month: 0 day: 0 hour: 0 minute: 0 - second: [dTZ secondsFromGMT]]; + return cDate; } - (BOOL) isDateInSameMonth: (NSCalendarDate *) _other