Skip to content

Commit

Permalink
fix indentation and capitalize Locales constant
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonjs committed Dec 28, 2016
1 parent 71737c8 commit e571efe
Showing 1 changed file with 126 additions and 167 deletions.
293 changes: 126 additions & 167 deletions strftime.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,17 @@

;(function() {

var locales = {
de_DE: {
days: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag',
'Freitag', 'Samstag'],
shortDays: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
months: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli',
'August', 'September', 'Oktober', 'November', 'Dezember'],
shortMonths: ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul',
'Aug', 'Sep', 'Okt', 'Nov', 'Dez'],
AM: 'AM',
PM: 'PM',
am: 'am',
pm: 'pm',
formats: {
var Locales = {
de_DE: {
days: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'],
shortDays: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
months: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'],
shortMonths: ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'],
AM: 'AM',
PM: 'PM',
am: 'am',
pm: 'pm',
formats: {
c: '%a %d %b %Y %X %Z',
D: '%d.%m.%Y',
F: '%Y-%m-%d',
Expand All @@ -34,22 +31,25 @@
v: '%e-%b-%Y',
X: '%T',
x: '%D'
}
},

en_US: {
days: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday',
'Friday', 'Saturday' ],
shortDays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
months: ['January', 'February', 'March', 'April', 'May', 'June',
'July', 'August', 'September', 'October', 'November', 'December'],
shortMonths: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug',
'Sep', 'Oct', 'Nov', 'Dec'],
AM: 'AM',
PM: 'PM',
am: 'am',
pm: 'pm',
formats: {
}
},

en_US: {
days: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' ],
shortDays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
shortMonths: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
ordinalSuffixes: [
'st', 'nd', 'rd', 'th', 'th', 'th', 'th', 'th', 'th', 'th',
'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th',
'st', 'nd', 'rd', 'th', 'th', 'th', 'th', 'th', 'th', 'th',
'st'
],
AM: 'AM',
PM: 'PM',
am: 'am',
pm: 'pm',
formats: {
c: '%a %d %b %Y %X %Z',
D: '%m/%d/%y',
F: '%Y-%m-%d',
Expand All @@ -59,22 +59,19 @@
v: '%e-%b-%Y',
X: '%r',
x: '%D'
}
},

es_MX: {
days: ['domingo', 'lunes', 'martes', 'miércoles', 'jueves', 'viernes',
'sábado'],
shortDays: ['dom', 'lun', 'mar', 'mié', 'jue', 'vie', 'sáb'],
months: ['enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio',
'julio', 'agosto', 'septiembre', 'octubre', 'noviembre',' diciembre'],
shortMonths: ['ene', 'feb', 'mar', 'abr', 'may', 'jun', 'jul', 'ago',
'sep', 'oct', 'nov', 'dic'],
AM: 'AM',
PM: 'PM',
am: 'am',
pm: 'pm',
formats: {
}
},

es_MX: {
days: ['domingo', 'lunes', 'martes', 'miércoles', 'jueves', 'viernes', 'sábado'],
shortDays: ['dom', 'lun', 'mar', 'mié', 'jue', 'vie', 'sáb'],
months: ['enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre',' diciembre'],
shortMonths: ['ene', 'feb', 'mar', 'abr', 'may', 'jun', 'jul', 'ago', 'sep', 'oct', 'nov', 'dic'],
AM: 'AM',
PM: 'PM',
am: 'am',
pm: 'pm',
formats: {
c: '%a %d %b %Y %X %Z',
D: '%d/%m/%Y',
F: '%Y-%m-%d',
Expand All @@ -84,22 +81,19 @@
v: '%e-%b-%Y',
X: '%T',
x: '%D'
}
},

fr_FR: {
days: ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi',
'samedi'],
shortDays: ['dim.', 'lun.', 'mar.', 'mer.', 'jeu.', 'ven.', 'sam.'],
months: ['janvier', 'février', 'mars', 'avril', 'mai', 'juin',
'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre'],
shortMonths: ['janv.', 'févr.', 'mars', 'avril', 'mai', 'juin',
'juil.', 'août', 'sept.', 'oct.', 'nov.', 'déc.'],
AM: 'AM',
PM: 'PM',
am: 'am',
pm: 'pm',
formats: {
}
},

fr_FR: {
days: ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi'],
shortDays: ['dim.', 'lun.', 'mar.', 'mer.', 'jeu.', 'ven.', 'sam.'],
months: ['janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre'],
shortMonths: ['janv.', 'févr.', 'mars', 'avril', 'mai', 'juin', 'juil.', 'août', 'sept.', 'oct.', 'nov.', 'déc.'],
AM: 'AM',
PM: 'PM',
am: 'am',
pm: 'pm',
formats: {
c: '%a %d %b %Y %X %Z',
D: '%d/%m/%Y',
F: '%Y-%m-%d',
Expand All @@ -109,22 +103,19 @@
v: '%e-%b-%Y',
X: '%T',
x: '%D'
}
},

it_IT: {
days: ['domenica', 'lunedì', 'martedì', 'mercoledì', 'giovedì',
'venerdì', 'sabato'],
shortDays: ['dom', 'lun', 'mar', 'mer', 'gio', 'ven', 'sab'],
months: ['gennaio', 'febbraio', 'marzo', 'aprile', 'maggio', 'giugno',
'luglio', 'agosto', 'settembre', 'ottobre', 'novembre', 'dicembre'],
shortMonths: ['pr', 'mag', 'giu', 'lug', 'ago', 'set', 'ott', 'nov',
'dic'],
AM: 'AM',
PM: 'PM',
am: 'am',
pm: 'pm',
formats: {
}
},

it_IT: {
days: ['domenica', 'lunedì', 'martedì', 'mercoledì', 'giovedì', 'venerdì', 'sabato'],
shortDays: ['dom', 'lun', 'mar', 'mer', 'gio', 'ven', 'sab'],
months: ['gennaio', 'febbraio', 'marzo', 'aprile', 'maggio', 'giugno', 'luglio', 'agosto', 'settembre', 'ottobre', 'novembre', 'dicembre'],
shortMonths: ['pr', 'mag', 'giu', 'lug', 'ago', 'set', 'ott', 'nov', 'dic'],
AM: 'AM',
PM: 'PM',
am: 'am',
pm: 'pm',
formats: {
c: '%a %d %b %Y %X %Z',
D: '%d/%m/%Y',
F: '%Y-%m-%d',
Expand All @@ -134,22 +125,19 @@
v: '%e-%b-%Y',
X: '%T',
x: '%D'
}
},

nl_NL: {
days: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag',
'vrijdag', 'zaterdag'],
shortDays: ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'],
months: ['januari', 'februari', 'maart', 'april', 'mei', 'juni',
'juli', 'augustus', 'september', 'oktober', 'november', 'december'],
shortMonths: ['jan', 'feb', 'mrt', 'apr', 'mei', 'jun', 'jul', 'aug',
'sep', 'okt', 'nov', 'dec'],
AM: 'AM',
PM: 'PM',
am: 'am',
pm: 'pm',
formats: {
}
},

nl_NL: {
days: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'],
shortDays: ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'],
months: ['januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december'],
shortMonths: ['jan', 'feb', 'mrt', 'apr', 'mei', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'],
AM: 'AM',
PM: 'PM',
am: 'am',
pm: 'pm',
formats: {
c: '%a %d %b %Y %X %Z',
D: '%d-%m-%y',
F: '%Y-%m-%d',
Expand All @@ -159,22 +147,19 @@
v: '%e-%b-%Y',
X: '%T',
x: '%D'
}
},

pt_BR: {
days: ['domingo', 'segunda', 'terça', 'quarta', 'quinta', 'sexta',
'sábado'],
shortDays: ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sáb'],
months: ['janeiro', 'fevereiro', 'março', 'abril', 'maio', 'junho',
'julho', 'agosto', 'setembro', 'outubro', 'novembro', 'dezembro'],
shortMonths: ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago',
'Set', 'Out', 'Nov', 'Dez'],
AM: 'AM',
PM: 'PM',
am: 'am',
pm: 'pm',
formats: {
}
},

pt_BR: {
days: ['domingo', 'segunda', 'terça', 'quarta', 'quinta', 'sexta', 'sábado'],
shortDays: ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sáb'],
months: ['janeiro', 'fevereiro', 'março', 'abril', 'maio', 'junho', 'julho', 'agosto', 'setembro', 'outubro', 'novembro', 'dezembro'],
shortMonths: ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'],
AM: 'AM',
PM: 'PM',
am: 'am',
pm: 'pm',
formats: {
c: '%a %d %b %Y %X %Z',
D: '%d-%m-%Y',
F: '%Y-%m-%d',
Expand All @@ -184,22 +169,19 @@
v: '%e-%b-%Y',
X: '%T',
x: '%D'
}
},

ru_RU: {
days: ['Воскресенье', 'Понедельник', 'Вторник', 'Среда', 'Четверг',
'Пятница', 'Суббота'],
shortDays: ['Вс', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб'],
months: ['Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь',
'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'],
shortMonths: ['янв', 'фев', 'мар', 'апр', 'май', 'июн', 'июл',
'авг', 'сен', 'окт', 'ноя', 'дек'],
AM: 'AM',
PM: 'PM',
am: 'am',
pm: 'pm',
formats: {
}
},

ru_RU: {
days: ['Воскресенье', 'Понедельник', 'Вторник', 'Среда', 'Четверг', 'Пятница', 'Суббота'],
shortDays: ['Вс', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб'],
months: ['Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'],
shortMonths: ['янв', 'фев', 'мар', 'апр', 'май', 'июн', 'июл', 'авг', 'сен', 'окт', 'ноя', 'дек'],
AM: 'AM',
PM: 'PM',
am: 'am',
pm: 'pm',
formats: {
c: '%a %d %b %Y %X',
D: '%d.%m.%y',
F: '%Y-%m-%d',
Expand All @@ -209,22 +191,19 @@
v: '%e-%b-%Y',
X: '%T',
x: '%D'
}
},

tr_TR: {
days: ['Pazar', 'Pazartesi', 'Salı','Çarşamba', 'Perşembe', 'Cuma',
'Cumartesi'],
shortDays: ['Paz', 'Pzt', 'Sal', 'Çrş', 'Prş', 'Cum', 'Cts'],
months: ['Ocak', 'Şubat', 'Mart', 'Nisan', 'Mayıs', 'Haziran',
'Temmuz', 'Ağustos', 'Eylül', 'Ekim', 'Kasım', 'Aralık'],
shortMonths: ['Oca', 'Şub', 'Mar', 'Nis', 'May', 'Haz', 'Tem',
'Ağu', 'Eyl', 'Eki', 'Kas', 'Ara'],
AM: 'ÖÖ',
PM: 'ÖS',
am: 'ÖÖ',
pm: 'ÖS',
formats: {
}
},

tr_TR: {
days: ['Pazar', 'Pazartesi', 'Salı','Çarşamba', 'Perşembe', 'Cuma', 'Cumartesi'],
shortDays: ['Paz', 'Pzt', 'Sal', 'Çrş', 'Prş', 'Cum', 'Cts'],
months: ['Ocak', 'Şubat', 'Mart', 'Nisan', 'Mayıs', 'Haziran', 'Temmuz', 'Ağustos', 'Eylül', 'Ekim', 'Kasım', 'Aralık'],
shortMonths: ['Oca', 'Şub', 'Mar', 'Nis', 'May', 'Haz', 'Tem', 'Ağu', 'Eyl', 'Eki', 'Kas', 'Ara'],
AM: 'ÖÖ',
PM: 'ÖS',
am: 'ÖÖ',
pm: 'ÖS',
formats: {
c: '%a %d %b %Y %X %Z',
D: '%d-%m-%Y',
F: '%Y-%m-%d',
Expand All @@ -234,32 +213,11 @@
v: '%e-%b-%Y',
X: '%T',
x: '%D'
}
}
}
}
};

var DefaultLocale = {
days: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
shortDays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
shortMonths: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
ordinalSuffixes: ['st', 'nd', 'rd', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'st', 'nd', 'rd', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'st'],
AM: 'AM',
PM: 'PM',
am: 'am',
pm: 'pm',
formats: {
D: '%m/%d/%y',
F: '%Y-%m-%d',
R: '%H:%M',
T: '%H:%M:%S',
X: '%T',
c: '%a %b %d %X %Y',
r: '%I:%M:%S %p',
v: '%e-%b-%Y',
x: '%D'
}
},
var DefaultLocale = Locales['en_US'],
defaultStrftime = new Strftime(DefaultLocale, 0, false),
isCommonJS = typeof module !== 'undefined',
namespace;
Expand Down Expand Up @@ -775,7 +733,8 @@
};

strftime.localizeByIdentifier = function(localeIdentifier) {
return strftime.localize(locales[localeIdentifier]);
var locale = Locales[localeIdentifier];
return strftime.localize(locale);
};

strftime.timezone = function(timezone) {
Expand Down

0 comments on commit e571efe

Please sign in to comment.