From 1a58f1b4f92a378e008481b2e6ff319afd820258 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 22 Nov 2007 16:32:22 +0000 Subject: [PATCH] Monotone-Parent: c1fa71027de8d19eaa232cf89370ad4655d2d15b Monotone-Revision: 64e49d499c79080e88278175b2826dfc85d1c635 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-11-22T16:32:22 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 8 ++++++++ SoObjects/SOGo/NSCalendarDate+SOGo.h | 3 +++ SoObjects/SOGo/NSCalendarDate+SOGo.m | 25 +++++++++++++++++++++++++ 3 files changed, 36 insertions(+) diff --git a/ChangeLog b/ChangeLog index 883aa3377..b4f6d4fd7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-11-22 Wolfgang Sourdeau + + * SoObjects/SOGo/NSCalendarDate+SOGo.m ([NSCalendarDate + +distantFuture]): rewrote method to return an object that is + compatible with NSCalendarDate, unlike the implementation in + GNUstep. + ([NSCalendarDate +distantPast]): same as above. + 2007-11-21 Wolfgang Sourdeau * UI/MailPartViewers/UIxMailPartHTMLViewer.m: fixed infinite loop diff --git a/SoObjects/SOGo/NSCalendarDate+SOGo.h b/SoObjects/SOGo/NSCalendarDate+SOGo.h index ca6d710d3..61ad14f1d 100644 --- a/SoObjects/SOGo/NSCalendarDate+SOGo.h +++ b/SoObjects/SOGo/NSCalendarDate+SOGo.h @@ -41,6 +41,9 @@ - (NSString *) rfc822DateString; ++ (id) distantFuture; ++ (id) distantPast; + @end #endif /* NSCALENDARDATE_SCHEDULER_H */ diff --git a/SoObjects/SOGo/NSCalendarDate+SOGo.m b/SoObjects/SOGo/NSCalendarDate+SOGo.m index c3cd24921..1084f066a 100644 --- a/SoObjects/SOGo/NSCalendarDate+SOGo.m +++ b/SoObjects/SOGo/NSCalendarDate+SOGo.m @@ -136,4 +136,29 @@ static NSString *rfc822Months[] = {@"", @"Jan", @"Feb", @"Mar", @"Apr", timeZoneShift]; } +#define secondsOfDistantFuture 63113990400.0 +#define secondsOfDistantPast -63113817600.0 + ++ (id) distantFuture +{ + static NSCalendarDate *date = nil; + + if (!date) + date + = [[self alloc] initWithTimeIntervalSinceReferenceDate: secondsOfDistantFuture]; + + return date; +} + ++ (id) distantPast +{ + static NSCalendarDate *date = nil; + + if (!date) + date + = [[self alloc] initWithTimeIntervalSinceReferenceDate: secondsOfDistantPast]; + + return date; +} + @end