From c1fdbcfe1aad36f3cab16eb85a3877cbc0b325d1 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 19 Jun 2007 19:42:25 +0000 Subject: [PATCH] Monotone-Parent: d9a69894dba4cd1b601ba9795b1c0a7b03a477c1 Monotone-Revision: 9ca5fa1849f6316f47f2cf976b80f00e5ff0fc76 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-06-19T19:42:25 Monotone-Branch: ca.inverse.sogo --- UI/Scheduler/UIxCalMonthView.h | 3 +++ UI/Scheduler/UIxCalMonthView.m | 35 +++++++++++++++++++++------------- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/UI/Scheduler/UIxCalMonthView.h b/UI/Scheduler/UIxCalMonthView.h index 48190556c..830c17cac 100644 --- a/UI/Scheduler/UIxCalMonthView.h +++ b/UI/Scheduler/UIxCalMonthView.h @@ -44,6 +44,9 @@ NSArray *daysToDisplay; NSCalendarDate *currentTableDay; NSArray *currentTableColumn; + + NSArray *dayNames; + NSArray *monthNames; } - (NSDictionary *) monthBeforePrevMonthQueryParameters; diff --git a/UI/Scheduler/UIxCalMonthView.m b/UI/Scheduler/UIxCalMonthView.m index 9f3076650..0bd425d98 100644 --- a/UI/Scheduler/UIxCalMonthView.m +++ b/UI/Scheduler/UIxCalMonthView.m @@ -36,13 +36,20 @@ - (id) init { + NSDictionary *locale; + if ((self = [super init])) { - monthAptFormatter - = [[SOGoAptFormatter alloc] initWithDisplayTimeZone: timeZone]; - [monthAptFormatter setShortMonthTitleOnly]; - dateFormatter = [[SOGoDateFormatter alloc] - initWithLocale: [self locale]]; +// monthAptFormatter +// = [[SOGoAptFormatter alloc] initWithDisplayTimeZone: timeZone]; +// [monthAptFormatter setShortMonthTitleOnly]; +// dateFormatter = [[SOGoDateFormatter alloc] +// initWithLocale: [self locale]]; + locale = [context valueForKey: @"locale"]; + dayNames = [locale objectForKey: NSWeekDayNameArray]; + [dayNames retain]; + monthNames = [locale objectForKey: NSMonthNameArray]; + [monthNames retain]; sortedAppointments = [NSMutableDictionary new]; daysToDisplay = nil; } @@ -50,16 +57,18 @@ return self; } -- (SOGoAptFormatter *) monthAptFormatter -{ - return monthAptFormatter; -} +// - (SOGoAptFormatter *) monthAptFormatter +// { +// return monthAptFormatter; +// } - (void) dealloc { + [monthNames release]; + [dayNames release]; [daysToDisplay release]; - [monthAptFormatter release]; - [dateFormatter release]; +// [monthAptFormatter release]; +// [dateFormatter release]; [sortedAppointments release]; [super dealloc]; } @@ -111,7 +120,7 @@ - (NSString *) labelForCurrentDayToDisplay { - return [dateFormatter fullDayOfWeek: [currentTableDay dayOfWeek]]; + return [dayNames objectAtIndex: [currentTableDay dayOfWeek]]; } - (NSDictionary *) _dateQueryParametersWithOffset: (int) monthsOffset @@ -211,7 +220,7 @@ || [currentTableDay isDateOnSameDay: lastDayOfMonth]) { monthOfYear - = [dateFormatter shortMonthOfYear: [currentTableDay monthOfYear]]; + = [monthNames objectAtIndex: [currentTableDay monthOfYear]]; label = [NSString stringWithFormat: @"%d %@", dayOfMonth, monthOfYear]; } else