Monotone-Parent: d9a69894dba4cd1b601ba9795b1c0a7b03a477c1

Monotone-Revision: 9ca5fa1849f6316f47f2cf976b80f00e5ff0fc76

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-06-19T19:42:25
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2007-06-19 19:42:25 +00:00
parent 1c9840682b
commit c1fdbcfe1a
2 changed files with 25 additions and 13 deletions

View File

@ -44,6 +44,9 @@
NSArray *daysToDisplay; NSArray *daysToDisplay;
NSCalendarDate *currentTableDay; NSCalendarDate *currentTableDay;
NSArray *currentTableColumn; NSArray *currentTableColumn;
NSArray *dayNames;
NSArray *monthNames;
} }
- (NSDictionary *) monthBeforePrevMonthQueryParameters; - (NSDictionary *) monthBeforePrevMonthQueryParameters;

View File

@ -36,13 +36,20 @@
- (id) init - (id) init
{ {
NSDictionary *locale;
if ((self = [super init])) if ((self = [super init]))
{ {
monthAptFormatter // monthAptFormatter
= [[SOGoAptFormatter alloc] initWithDisplayTimeZone: timeZone]; // = [[SOGoAptFormatter alloc] initWithDisplayTimeZone: timeZone];
[monthAptFormatter setShortMonthTitleOnly]; // [monthAptFormatter setShortMonthTitleOnly];
dateFormatter = [[SOGoDateFormatter alloc] // dateFormatter = [[SOGoDateFormatter alloc]
initWithLocale: [self locale]]; // initWithLocale: [self locale]];
locale = [context valueForKey: @"locale"];
dayNames = [locale objectForKey: NSWeekDayNameArray];
[dayNames retain];
monthNames = [locale objectForKey: NSMonthNameArray];
[monthNames retain];
sortedAppointments = [NSMutableDictionary new]; sortedAppointments = [NSMutableDictionary new];
daysToDisplay = nil; daysToDisplay = nil;
} }
@ -50,16 +57,18 @@
return self; return self;
} }
- (SOGoAptFormatter *) monthAptFormatter // - (SOGoAptFormatter *) monthAptFormatter
{ // {
return monthAptFormatter; // return monthAptFormatter;
} // }
- (void) dealloc - (void) dealloc
{ {
[monthNames release];
[dayNames release];
[daysToDisplay release]; [daysToDisplay release];
[monthAptFormatter release]; // [monthAptFormatter release];
[dateFormatter release]; // [dateFormatter release];
[sortedAppointments release]; [sortedAppointments release];
[super dealloc]; [super dealloc];
} }
@ -111,7 +120,7 @@
- (NSString *) labelForCurrentDayToDisplay - (NSString *) labelForCurrentDayToDisplay
{ {
return [dateFormatter fullDayOfWeek: [currentTableDay dayOfWeek]]; return [dayNames objectAtIndex: [currentTableDay dayOfWeek]];
} }
- (NSDictionary *) _dateQueryParametersWithOffset: (int) monthsOffset - (NSDictionary *) _dateQueryParametersWithOffset: (int) monthsOffset
@ -211,7 +220,7 @@
|| [currentTableDay isDateOnSameDay: lastDayOfMonth]) || [currentTableDay isDateOnSameDay: lastDayOfMonth])
{ {
monthOfYear monthOfYear
= [dateFormatter shortMonthOfYear: [currentTableDay monthOfYear]]; = [monthNames objectAtIndex: [currentTableDay monthOfYear]];
label = [NSString stringWithFormat: @"%d %@", dayOfMonth, monthOfYear]; label = [NSString stringWithFormat: @"%d %@", dayOfMonth, monthOfYear];
} }
else else