mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-27 06:15:26 +00:00
@@ -232,6 +232,11 @@
|
||||
// Add strings from Locale
|
||||
NSDictionary *moreStrings;
|
||||
|
||||
// AM/PM
|
||||
moreStrings = [NSDictionary dictionaryWithObjects: [locale objectForKey: NSAMPMDesignation]
|
||||
forKeys: [UIxComponent amPmLabelKeys]];
|
||||
[strings addEntriesFromDictionary: moreStrings];
|
||||
|
||||
// Month names
|
||||
moreStrings = [NSDictionary dictionaryWithObjects: [locale objectForKey: NSMonthNameArray]
|
||||
forKeys: [UIxComponent monthLabelKeys]];
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
/*
|
||||
Copyright (C) 2000-2005 SKYRIX Software AG
|
||||
Copyright (C) 2007-2016 Inverse inc.
|
||||
|
||||
This file is part of OpenGroupware.org.
|
||||
This file is part of SOGo
|
||||
|
||||
OGo is free software; you can redistribute it and/or modify it under
|
||||
SOGo is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU Lesser General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option) any
|
||||
later version.
|
||||
|
||||
OGo is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
SOGo is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
||||
License for more details.
|
||||
@@ -46,6 +47,7 @@
|
||||
NSArray *languages;
|
||||
}
|
||||
|
||||
+ (NSArray *) amPmLabelKeys;
|
||||
+ (NSArray *) monthLabelKeys;
|
||||
+ (NSArray *) abbrMonthLabelKeys;
|
||||
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
|
||||
@implementation UIxComponent
|
||||
|
||||
static NSMutableArray *amPmLabelKeys = nil;
|
||||
static NSMutableArray *dayLabelKeys = nil;
|
||||
static NSMutableArray *abbrDayLabelKeys = nil;
|
||||
static NSMutableArray *monthLabelKeys = nil;
|
||||
@@ -72,6 +73,10 @@ static SoProduct *commonProduct = nil;
|
||||
|
||||
+ (void)initialize {
|
||||
if (dayLabelKeys == nil) {
|
||||
amPmLabelKeys = [[NSMutableArray alloc] initWithCapacity:2];
|
||||
[amPmLabelKeys addObject:@"AM"];
|
||||
[amPmLabelKeys addObject:@"PM"];
|
||||
|
||||
dayLabelKeys = [[NSMutableArray alloc] initWithCapacity:7];
|
||||
[dayLabelKeys addObject:@"Sunday"];
|
||||
[dayLabelKeys addObject:@"Monday"];
|
||||
@@ -124,6 +129,11 @@ static SoProduct *commonProduct = nil;
|
||||
}
|
||||
}
|
||||
|
||||
+ (NSArray *) amPmLabelKeys
|
||||
{
|
||||
return (NSArray *) amPmLabelKeys;
|
||||
}
|
||||
|
||||
+ (NSArray *) abbrDayLabelKeys
|
||||
{
|
||||
return (NSArray *) abbrDayLabelKeys;
|
||||
|
||||
@@ -394,6 +394,7 @@ Date.prototype.format = function(localeProvider, format) {
|
||||
'%H': this.getHours(), // hour (00..23)
|
||||
'%M': this.getMinutes() }; // minute (00..59)
|
||||
val['%I'] = val['%H'] > 12 ? val['%H'] % 12 : val['%H']; // hour (01..12)
|
||||
val['%p'] = val['%H'] < 12 ? l('AM') : l('PM'); // locale's equivalent of either AM or PM
|
||||
|
||||
val['%d'] = (val['%d'] < 10 ? '0' : '') + val['%d'];
|
||||
val['%e'] = (val['%e'] < 10 ? ' ' : '') + val['%e'];
|
||||
|
||||
Reference in New Issue
Block a user