Monotone-Parent: 30278078dfd012e96e074c87b01c0c3a5fab2bbc
Monotone-Revision: 4aebe8e414a3fcd8c8f09db947a8221f926ab5cd

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2008-12-23T00:12:14
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Francis Lachapelle 2008-12-23 00:12:14 +00:00
parent b47c7216fd
commit 07e108baf5
4 changed files with 23 additions and 8 deletions

View File

@ -447,7 +447,7 @@ _timeValue (NSString *key)
if (!dateFormatter)
{
dateFormatter = [SOGoDateFormatter new];
[dateFormatter setLocale: [context valueForKey: @"locale"]];
[dateFormatter setLocale: [[WOApplication application] localeForLanguageNamed: [self language]]];
ud = [self userDefaults];
format = [ud stringForKey: @"ShortDateFormat"];
if (format)

View File

@ -34,6 +34,7 @@
{
id item;
SOGoUser *user;
NSDictionary *locale;
NSUserDefaults *userDefaults;
NSCalendarDate *today;
NSMutableArray *hours;

View File

@ -65,16 +65,20 @@ static BOOL shouldDisplayAdditionalPreferences = NO;
- (id) init
{
NSDictionary *locale;
//NSDictionary *locale;
NSString *language;
if ((self = [super init]))
{
language = [[context activeUser] language];
item = nil;
hours = nil;
ASSIGN (user, [context activeUser]);
ASSIGN (userDefaults, [user userDefaults]);
ASSIGN (today, [NSCalendarDate date]);
locale = [context valueForKey: @"locale"];
//locale = [context valueForKey: @"locale"];
ASSIGN (locale, [[WOApplication application] localeForLanguageNamed: language]);
ASSIGN (daysOfWeek,
[locale objectForKey: NSWeekDayNameArray]);
hasChanged = NO;
@ -91,6 +95,7 @@ static BOOL shouldDisplayAdditionalPreferences = NO;
[userDefaults release];
[hours release];
[daysOfWeek release];
[locale release];
[super dealloc];
}
@ -185,7 +190,8 @@ static BOOL shouldDisplayAdditionalPreferences = NO;
- (NSString *) itemShortDateFormatText
{
return [today descriptionWithCalendarFormat: item
locale: [context valueForKey: @"locale"]];
locale: locale];
//locale: [context valueForKey: @"locale"]];
}
- (NSString *) userShortDateFormat
@ -228,7 +234,8 @@ static BOOL shouldDisplayAdditionalPreferences = NO;
- (NSString *) itemLongDateFormatText
{
return [today descriptionWithCalendarFormat: item
locale: [context valueForKey: @"locale"]];
locale: locale];
//locale: [context valueForKey: @"locale"]];
}
- (NSString *) userLongDateFormat
@ -271,7 +278,8 @@ static BOOL shouldDisplayAdditionalPreferences = NO;
- (NSString *) itemTimeFormatText
{
return [today descriptionWithCalendarFormat: item
locale: [context valueForKey: @"locale"]];
locale: locale];
//locale: [context valueForKey: @"locale"]];
}
- (NSString *) userTimeFormat

View File

@ -44,17 +44,23 @@
{
if ((self = [super init]))
{
NSDictionary *locale;
NSString *language;
language = [[context activeUser] language];
locale = [[WOApplication application] localeForLanguageNamed: language];
daysToDisplay = nil;
hoursToDisplay = nil;
numberOfDays = 1;
startDate = nil;
currentTableDay = nil;
currentTableHour = nil;
weekDays = [[context valueForKey: @"locale"] objectForKey: NSShortWeekDayNameArray];
weekDays = [locale objectForKey: NSShortWeekDayNameArray];
[weekDays retain];
dateFormatter = [[context activeUser] dateFormatterInContext: context];
}
return self;
}