From 41c9c4f253d154822a88541344a0db9efe06b287 Mon Sep 17 00:00:00 2001 From: Kuba Brecka Date: Wed, 27 Mar 2013 09:29:25 +0100 Subject: [PATCH] update Sugar.js localized date formats --- .../javascripts/locales/date_locales.js | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/app/assets/javascripts/locales/date_locales.js b/app/assets/javascripts/locales/date_locales.js index 192ff9ba9db..5c07d75550c 100644 --- a/app/assets/javascripts/locales/date_locales.js +++ b/app/assets/javascripts/locales/date_locales.js @@ -29,12 +29,33 @@ Date.addLocale('cs', { } }); +// create DA locale, because it's not supported by Sugar at all +// TODO: currently just English, needs to be translated and localized +Date.addLocale('da', { + 'plural': true, + 'capitalizeUnit': false, + 'months': 'January,February,March,April,May,June,July,August,September,October,November,December', + 'weekdays': 'Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday', + 'units': 'millisecond:|s,second:|s,minute:|s,hour:|s,day:|s,week:|s,month:|s,year:|s', + 'short': '{Month} {d}, {yyyy}', + 'short_no_year': '{Month} {d}', + 'long': '{Month} {d}, {yyyy} {h}:{mm}{tt}', + 'full': '{Weekday} {Month} {d}, {yyyy} {h}:{mm}:{ss}{tt}', + 'past': '{num} {unit} {sign}', + 'future': '{num} {unit} {sign}', + 'duration': '{num} {unit}' +}); + + // fix DE locale Date.getLocale('de').short_no_year = '{d}. {month}'; // fix EN locale Date.getLocale('en').short_no_year = '{d} {Mon}'; +// fix ES locale +Date.getLocale('es').short_no_year = '{d} {month}'; + // fix FR locale Date.getLocale('fr').short_no_year = '{d} {month}'; @@ -55,6 +76,9 @@ Date.addLocale('id', { 'duration': '{num} {unit}' }); +// fix IT locale +Date.getLocale('it').short_no_year = '{d} {Month}'; + // fix NL locale Date.getLocale('nl').short_no_year = '{d} {Month}';