From d35fb1e2e0596e3ab3d56fca1e3a8d880576b05e Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 4 Oct 2006 19:23:00 +0000 Subject: [PATCH] Monotone-Parent: 4413311b33917d53e558500df415e44da781815b Monotone-Revision: c1b279e1252698e03e454f3e9d445b939afa2c43 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-10-04T19:23:00 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++++ UI/Scheduler/NSCalendarDate+Scheduler.h | 1 + UI/Scheduler/NSCalendarDate+Scheduler.m | 12 ++++++++++++ 3 files changed, 17 insertions(+) diff --git a/ChangeLog b/ChangeLog index ed0a709c0..1df164867 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2006-10-04 Wolfgang Sourdeau + * UI/Scheduler/NSCalendarDate+Scheduler.m ([NSCalendarDate + -shortDateString]): new method that will return a "short date + string" (yyyymmdd) from a calendar date object. + * UI/SOGoUI/UIxComponent.m ([UIxComponent -_cDateFromShortDateString:dateStringandShortTimeString:timeString]): new method to compute the selected date from the "day" and "hm" query parameters (if found). This method replaces the old algorithm that was found in the "selectedDate" method. diff --git a/UI/Scheduler/NSCalendarDate+Scheduler.h b/UI/Scheduler/NSCalendarDate+Scheduler.h index 48029e38c..18bcd310c 100644 --- a/UI/Scheduler/NSCalendarDate+Scheduler.h +++ b/UI/Scheduler/NSCalendarDate+Scheduler.h @@ -30,6 +30,7 @@ - (NSCalendarDate *) dayOfWeeK: (unsigned) _day offsetFromSunday: (unsigned) _off; - (NSCalendarDate *) sundayOfWeek; +- (NSString *) shortDateString; @end diff --git a/UI/Scheduler/NSCalendarDate+Scheduler.m b/UI/Scheduler/NSCalendarDate+Scheduler.m index 87c0169ab..e736217da 100644 --- a/UI/Scheduler/NSCalendarDate+Scheduler.m +++ b/UI/Scheduler/NSCalendarDate+Scheduler.m @@ -54,4 +54,16 @@ return [self dayOfWeeK:6 offsetFromSunday:1]; } +- (NSString *) shortDateString +{ + NSString *str; + + str = [NSString stringWithFormat: @"%.4d%.2d%.2d", + [self yearOfCommonEra], + [self monthOfYear], + [self dayOfMonth]]; + + return str; +} + @end