Added node-modules

This commit is contained in:
Dobie Wollert
2014-09-14 07:04:16 -04:00
parent 663941bf57
commit 6a92348cf5
4870 changed files with 670395 additions and 0 deletions

26
node_modules/emailjs/node_modules/moment/.jshintrc generated vendored Normal file
View File

@ -0,0 +1,26 @@
{
"node" : true,
"es5" : true,
"browser" : true,
"boss" : false,
"curly": true,
"debug": false,
"devel": false,
"eqeqeq": true,
"eqnull": true,
"evil": false,
"forin": false,
"immed": false,
"laxbreak": false,
"newcap": true,
"noarg": true,
"noempty": false,
"nonew": false,
"onevar": true,
"plusplus": false,
"regexp": false,
"undef": true,
"sub": true,
"strict": false,
"white": true
}

2
node_modules/emailjs/node_modules/moment/.npmignore generated vendored Normal file
View File

@ -0,0 +1,2 @@
node_modules/
.DS_Store

5
node_modules/emailjs/node_modules/moment/.travis.yml generated vendored Normal file
View File

@ -0,0 +1,5 @@
language: node_js
node_js:
- 0.4
- 0.6
- 0.8

22
node_modules/emailjs/node_modules/moment/LICENSE generated vendored Normal file
View File

@ -0,0 +1,22 @@
Copyright (c) 2011-2012 Tim Wood
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

71
node_modules/emailjs/node_modules/moment/Makefile generated vendored Normal file
View File

@ -0,0 +1,71 @@
LANG_ALL = $(wildcard lang/*.js)
MIN_LANG_ALL = $(addprefix min/,$(LANG_ALL))
.PHONY: all
all: moment langs
min/:
mkdir min/
min/lang/:
mkdir -p min/lang/
.PHONY: moment pretty
moment: min/ min/moment.min.js pretty
pretty: min/ min/moment.min.pretty.js
min/moment.min.js: moment.js
node_modules/.bin/uglifyjs -o $@ $<
min/moment.min.pretty.js: moment.js
node_modules/.bin/uglifyjs -b -o $@ $<
min/lang/%: lang/%
node_modules/.bin/uglifyjs -o $@ $<
min/lang-all.min.js: $(LANG_ALL)
cat $^ | node_modules/.bin/uglifyjs -o $@
.PHONY: langs
langs: min/lang/ $(MIN_LANG_ALL) min/lang-all.min.js
.PHONY: size
size: moment langs
# FILESIZE FOR ALL LANGS
cp min/lang-all.min.js min/lang-all.min.gzip.js
gzip min/lang-all.min.gzip.js
gzip -l min/lang-all.min.gzip.js.gz
rm min/lang-all.min.gzip.js.gz
# FILESIZE FOR LIBRARY
cp min/moment.min.js min/moment.min.gzip.js
gzip min/moment.min.gzip.js
gzip -l min/moment.min.gzip.js.gz
rm min/moment.min.gzip.js.gz
.PHONY: size-history
size-history: moment
node test/filesize-history.js
size-diff: moment
node test/filesize-diff.js
.PHONY: test hint test-moment test-lang
test: hint test-moment test-lang
test-zone:
node test/zone
hint:
node_modules/.bin/jshint moment.js
test-moment:
node_modules/.bin/nodeunit ./test/moment
test-lang:
node_modules/.bin/nodeunit ./test/lang
.PHONY: clean
clean:
rm -rf min/

1
node_modules/emailjs/node_modules/moment/ender.js generated vendored Normal file
View File

@ -0,0 +1 @@
$.ender({ moment: require('moment') })

66
node_modules/emailjs/node_modules/moment/lang/bg.js generated vendored Normal file
View File

@ -0,0 +1,66 @@
// moment.js language configuration
// language : bulgarian (bg)
// author : Krasen Borisov : https://github.com/kraz
(function () {
var lang = {
months : "януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),
monthsShort : "янрев_мар_апрай_юни_юли_авг_сеп_окт_ноеек".split("_"),
weekdays : еделя_понеделник_вторник_срядаетвъртък_петък_събота".split("_"),
weekdaysShort : ед_пон_вто_сря_чет_пет_съб".split("_"),
weekdaysMin : "нд_пн_вт_ср_чт_пт_сб".split("_"),
longDateFormat : {
LT : "h:mm",
L : "D.MM.YYYY",
LL : "D MMMM YYYY",
LLL : "D MMMM YYYY LT",
LLLL : "dddd, D MMMM YYYY LT"
},
calendar : {
sameDay : '[Днес в] LT',
nextDay : '[Утре в] LT',
nextWeek : 'dddd [в] LT',
lastDay : '[Вчера в] LT',
lastWeek : function () {
switch (this.day()) {
case 0:
case 3:
case 6:
return '[В изминалата] dddd [в] LT';
case 1:
case 2:
case 4:
case 5:
return '[В изминалия] dddd [в] LT';
}
},
sameElse : 'L'
},
relativeTime : {
future : "след %s",
past : "преди %s",
s : "няколко секунди",
m : "минута",
mm : "%d минути",
h : "час",
hh : "%d часа",
d : "ден",
dd : "%d дни",
M : "месец",
MM : "%d месеца",
y : "година",
yy : "%d години"
},
ordinal : function (number) {
return '.';
}
};
// Node
if (typeof module !== 'undefined') {
module.exports = lang;
}
// Browser
if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
this.moment.lang('bg', lang);
}
}());

64
node_modules/emailjs/node_modules/moment/lang/ca.js generated vendored Normal file
View File

@ -0,0 +1,64 @@
// moment.js language configuration
// language : catalan (ca)
// author : Juan G. Hurtado : https://github.com/juanghurtado
(function () {
var lang = {
months : "Gener_Febrer_Març_Abril_Maig_Juny_Juliol_Agost_Setembre_Octubre_Novembre_Desembre".split("_"),
monthsShort : "Gen._Febr._Mar._Abr._Mai._Jun._Jul._Ag._Set._Oct._Nov._Des.".split("_"),
weekdays : "Diumenge_Dilluns_Dimarts_Dimecres_Dijous_Divendres_Dissabte".split("_"),
weekdaysShort : "Dg._Dl._Dt._Dc._Dj._Dv._Ds.".split("_"),
weekdaysMin : "Dg_Dl_Dt_Dc_Dj_Dv_Ds".split("_"),
longDateFormat : {
LT : "H:mm",
L : "DD/MM/YYYY",
LL : "D MMMM YYYY",
LLL : "D MMMM YYYY LT",
LLLL : "dddd D MMMM YYYY LT"
},
calendar : {
sameDay : function () {
return '[avui a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
},
nextDay : function () {
return '[demà a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
},
nextWeek : function () {
return 'dddd [a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
},
lastDay : function () {
return '[ahir a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
},
lastWeek : function () {
return '[el] dddd [passat a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
},
sameElse : 'L'
},
relativeTime : {
future : "en %s",
past : "fa %s",
s : "uns segons",
m : "un minut",
mm : "%d minuts",
h : "una hora",
hh : "%d hores",
d : "un dia",
dd : "%d dies",
M : "un mes",
MM : "%d mesos",
y : "un any",
yy : "%d anys"
},
ordinal : function (number) {
return 'º';
}
};
// Node
if (typeof module !== 'undefined' && module.exports) {
module.exports = lang;
}
// Browser
if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
this.moment.lang('ca', lang);
}
}());

54
node_modules/emailjs/node_modules/moment/lang/cv.js generated vendored Normal file
View File

@ -0,0 +1,54 @@
// moment.js language configuration
// language : chuvash (cv)
// author : Anatoly Mironov : https://github.com/mirontoli
(function () {
var lang = {
months : "кăрлач_нарăс_пуш_акаай_çĕртме_утă_çурла_авăн_юпа_чӳк_раштав".split("_"),
monthsShort : "кăрар_пуш_акаай_çĕр_утă_çур_ав_юпа_чӳк_раш".split("_"),
weekdays : "вырсарникун_тунтикун_ытларикун_юнкун_кĕçнерникун_эрнекун_шăматкун".split("_"),
weekdaysShort : "вырун_ытл_юн_кĕç_эрн_шăм".split("_"),
weekdaysMin : р_тн_ыт_юн_кç_эр_шм".split("_"),
longDateFormat : {
LT : "HH:mm",
L : "DD-MM-YYYY",
LL : "YYYY çулхи MMMM уйăхĕн D-мĕшĕ",
LLL : "YYYY çулхи MMMM уйăхĕн D-мĕшĕ, LT",
LLLL : "dddd, YYYY çулхи MMMM уйăхĕн D-мĕшĕ, LT"
},
calendar : {
sameDay: '[Паян] LT [сехетре]',
nextDay: '[Ыран] LT [сехетре]',
lastDay: '[Ĕнер] LT [сехетре]',
nextWeek: '[Çитес] dddd LT [сехетре]',
lastWeek: '[Иртнĕ] dddd LT [сехетре]',
sameElse: 'L'
},
relativeTime : {
future : "%sран",
past : "%s каялла",
s : "пĕр-ик çеккунт",
m : "пĕр минут",
mm : "%d минут",
h : "пĕр сехет",
hh : "%d сехет",
d : "пĕр кун",
dd : "%d кун",
M : "пĕр уйăх",
MM : "%d уйăх",
y : "пĕр çул",
yy : "%d çул"
},
ordinal : function (number) {
return '-мĕш';
}
};
// Node
if (typeof module !== 'undefined' && module.exports) {
module.exports = lang;
}
// Browser
if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
this.moment.lang('cv', lang);
}
}());

54
node_modules/emailjs/node_modules/moment/lang/da.js generated vendored Normal file
View File

@ -0,0 +1,54 @@
// moment.js language configuration
// language : danish (da)
// author : Ulrik Nielsen : https://github.com/mrbase
(function () {
var lang = {
months : "Januar_Februar_Marts_April_Maj_Juni_Juli_August_September_Oktober_November_December".split("_"),
monthsShort : "Jan_Feb_Mar_Apr_Maj_Jun_Jul_Aug_Sep_Okt_Nov_Dec".split("_"),
weekdays : "Søndag_Mandag_Tirsdag_Onsdag_Torsdag_Fredag_Lørdag".split("_"),
weekdaysShort : "Søn_Man_Tir_Ons_Tor_Fre_Lør".split("_"),
weekdaysMin : "Sø_Ma_Ti_On_To_Fr_Lø".split("_"),
longDateFormat : {
LT : "h:mm A",
L : "DD/MM/YYYY",
LL : "D MMMM YYYY",
LLL : "D MMMM YYYY h:mm A",
LLLL : "dddd D. MMMM, YYYY h:mm A"
},
calendar : {
sameDay : '[I dag kl.] LT',
nextDay : '[I morgen kl.] LT',
nextWeek : 'dddd [kl.] LT',
lastDay : '[I går kl.] LT',
lastWeek : '[sidste] dddd [kl] LT',
sameElse : 'L'
},
relativeTime : {
future : "om %s",
past : "%s siden",
s : "få sekunder",
m : "minut",
mm : "%d minutter",
h : "time",
hh : "%d timer",
d : "dag",
dd : "%d dage",
M : "månede",
MM : "%d måneder",
y : "år",
yy : "%d år"
},
ordinal : function (number) {
return '.';
}
};
// Node
if (typeof module !== 'undefined' && module.exports) {
module.exports = lang;
}
// Browser
if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
this.moment.lang('da', lang);
}
}());

54
node_modules/emailjs/node_modules/moment/lang/de.js generated vendored Normal file
View File

@ -0,0 +1,54 @@
// moment.js language configuration
// language : german (de)
// author : lluchs : https://github.com/lluchs
(function () {
var lang = {
months : "Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),
monthsShort : "Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),
weekdays : "Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),
weekdaysShort : "So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),
weekdaysMin : "So_Mo_Di_Mi_Do_Fr_Sa".split("_"),
longDateFormat : {
LT: "H:mm U\\hr",
L : "DD.MM.YYYY",
LL : "D. MMMM YYYY",
LLL : "D. MMMM YYYY LT",
LLLL : "dddd, D. MMMM YYYY LT"
},
calendar : {
sameDay: "[Heute um] LT",
sameElse: "L",
nextDay: '[Morgen um] LT',
nextWeek: 'dddd [um] LT',
lastDay: '[Gestern um] LT',
lastWeek: '[letzten] dddd [um] LT'
},
relativeTime : {
future : "in %s",
past : "vor %s",
s : "ein paar Sekunden",
m : "einer Minute",
mm : "%d Minuten",
h : "einer Stunde",
hh : "%d Stunden",
d : "einem Tag",
dd : "%d Tagen",
M : "einem Monat",
MM : "%d Monaten",
y : "einem Jahr",
yy : "%d Jahren"
},
ordinal : function (number) {
return '.';
}
};
// Node
if (typeof module !== 'undefined' && module.exports) {
module.exports = lang;
}
// Browser
if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
this.moment.lang('de', lang);
}
}());

58
node_modules/emailjs/node_modules/moment/lang/en-ca.js generated vendored Normal file
View File

@ -0,0 +1,58 @@
// moment.js language configuration
// language : canadian english (en-ca)
// author : Jonathan Abourbih : https://github.com/jonbca
(function () {
var lang = {
months : "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
monthsShort : "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),
weekdays : "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
weekdaysShort : "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),
weekdaysMin : "Su_Mo_Tu_We_Th_Fr_Sa".split("_"),
longDateFormat : {
LT : "h:mm A",
L : "YYYY-MM-DD",
LL : "D MMMM, YYYY",
LLL : "D MMMM, YYYY LT",
LLLL : "dddd, D MMMM, YYYY LT"
},
calendar : {
sameDay : '[Today at] LT',
nextDay : '[Tomorrow at] LT',
nextWeek : 'dddd [at] LT',
lastDay : '[Yesterday at] LT',
lastWeek : '[last] dddd [at] LT',
sameElse : 'L'
},
relativeTime : {
future : "in %s",
past : "%s ago",
s : "a few seconds",
m : "a minute",
mm : "%d minutes",
h : "an hour",
hh : "%d hours",
d : "a day",
dd : "%d days",
M : "a month",
MM : "%d months",
y : "a year",
yy : "%d years"
},
ordinal : function (number) {
var b = number % 10;
return (~~ (number % 100 / 10) === 1) ? 'th' :
(b === 1) ? 'st' :
(b === 2) ? 'nd' :
(b === 3) ? 'rd' : 'th';
}
};
// Node
if (typeof module !== 'undefined' && module.exports) {
module.exports = lang;
}
// Browser
if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
this.moment.lang('en-gb', lang);
}
}());

58
node_modules/emailjs/node_modules/moment/lang/en-gb.js generated vendored Normal file
View File

@ -0,0 +1,58 @@
// moment.js language configuration
// language : great britain english (en-gb)
// author : Chris Gedrim : https://github.com/chrisgedrim
(function () {
var lang = {
months : "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
monthsShort : "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),
weekdays : "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
weekdaysShort : "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),
weekdaysMin : "Su_Mo_Tu_We_Th_Fr_Sa".split("_"),
longDateFormat : {
LT : "h:mm A",
L : "DD/MM/YYYY",
LL : "D MMMM YYYY",
LLL : "D MMMM YYYY LT",
LLLL : "dddd, D MMMM YYYY LT"
},
calendar : {
sameDay : '[Today at] LT',
nextDay : '[Tomorrow at] LT',
nextWeek : 'dddd [at] LT',
lastDay : '[Yesterday at] LT',
lastWeek : '[last] dddd [at] LT',
sameElse : 'L'
},
relativeTime : {
future : "in %s",
past : "%s ago",
s : "a few seconds",
m : "a minute",
mm : "%d minutes",
h : "an hour",
hh : "%d hours",
d : "a day",
dd : "%d days",
M : "a month",
MM : "%d months",
y : "a year",
yy : "%d years"
},
ordinal : function (number) {
var b = number % 10;
return (~~ (number % 100 / 10) === 1) ? 'th' :
(b === 1) ? 'st' :
(b === 2) ? 'nd' :
(b === 3) ? 'rd' : 'th';
}
};
// Node
if (typeof module !== 'undefined' && module.exports) {
module.exports = lang;
}
// Browser
if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
this.moment.lang('en-gb', lang);
}
}());

64
node_modules/emailjs/node_modules/moment/lang/es.js generated vendored Normal file
View File

@ -0,0 +1,64 @@
// moment.js language configuration
// language : spanish (es)
// author : Julio Napurí : https://github.com/julionc
(function () {
var lang = {
months : "Enero_Febrero_Marzo_Abril_Mayo_Junio_Julio_Agosto_Septiembre_Octubre_Noviembre_Diciembre".split("_"),
monthsShort : "Ene._Feb._Mar._Abr._May._Jun._Jul._Ago._Sep._Oct._Nov._Dic.".split("_"),
weekdays : "Domingo_Lunes_Martes_Miércoles_Jueves_Viernes_Sábado".split("_"),
weekdaysShort : "Dom._Lun._Mar._Mié._Jue._Vie._Sáb.".split("_"),
weekdaysMin : "Do_Lu_Ma_Mi_Ju_Vi_Sá".split("_"),
longDateFormat : {
LT : "H:mm",
L : "DD/MM/YYYY",
LL : "D MMMM YYYY",
LLL : "D MMMM YYYY LT",
LLLL : "dddd D MMMM YYYY LT"
},
calendar : {
sameDay : function () {
return '[hoy a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
},
nextDay : function () {
return '[mañana a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
},
nextWeek : function () {
return 'dddd [a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
},
lastDay : function () {
return '[ayer a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
},
lastWeek : function () {
return '[el] dddd [pasado a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
},
sameElse : 'L'
},
relativeTime : {
future : "en %s",
past : "hace %s",
s : "unos segundos",
m : "un minuto",
mm : "%d minutos",
h : "una hora",
hh : "%d horas",
d : "un día",
dd : "%d días",
M : "un mes",
MM : "%d meses",
y : "un año",
yy : "%d años"
},
ordinal : function (number) {
return 'º';
}
};
// Node
if (typeof module !== 'undefined' && module.exports) {
module.exports = lang;
}
// Browser
if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
this.moment.lang('es', lang);
}
}());

54
node_modules/emailjs/node_modules/moment/lang/eu.js generated vendored Normal file
View File

@ -0,0 +1,54 @@
// moment.js language configuration
// language : euskara (eu)
// author : Eneko Illarramendi : https://github.com/eillarra
(function () {
var lang = {
months : "urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),
monthsShort : "urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),
weekdays : "igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),
weekdaysShort : "ig._al._ar._az._og._ol._lr.".split("_"),
weekdaysMin : "ig_al_ar_az_og_ol_lr".split("_"),
longDateFormat : {
LT : "HH:mm",
L : "YYYY-MM-DD",
LL : "YYYYko MMMMren D[a]",
LLL : "YYYYko MMMMren D[a] LT",
LLLL : "dddd, YYYYko MMMMren D[a] LT"
},
calendar : {
sameDay : '[gaur] LT[etan]',
nextDay : '[bihar] LT[etan]',
nextWeek : 'dddd LT[etan]',
lastDay : '[atzo] LT[etan]',
lastWeek : '[aurreko] dddd LT[etan]',
sameElse : 'L'
},
relativeTime : {
future : "%s barru",
past : "duela %s",
s : "segundo batzuk",
m : "minutu bat",
mm : "%d minutu",
h : "ordu bat",
hh : "%d ordu",
d : "egun bat",
dd : "%d egun",
M : "hilabete bat",
MM : "%d hilabete",
y : "urte bat",
yy : "%d urte"
},
ordinal : function (number) {
return '.';
}
};
// Node
if (typeof module !== 'undefined' && module.exports) {
module.exports = lang;
}
// Browser
if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
this.moment.lang('eu', lang);
}
}());

98
node_modules/emailjs/node_modules/moment/lang/fi.js generated vendored Normal file
View File

@ -0,0 +1,98 @@
// moment.js language configuration
// language : finnish (fi)
// author : Tarmo Aidantausta : https://github.com/bleadof
(function () {
var numbers_past = ['nolla', 'yksi', 'kaksi', 'kolme', 'neljä', 'viisi',
'kuusi', 'seitsemän', 'kahdeksan', 'yhdeksän'];
var numbers_future = ['nolla', 'yhden', 'kahden', 'kolmen', 'neljän', 'viiden',
'kuuden', numbers_past[7], numbers_past[8], numbers_past[9]];
function translate(number, withoutSuffix, key, isFuture) {
var result = "";
switch (key) {
case 's':
return isFuture ? 'muutaman sekunnin' : 'muutama sekunti';
case 'm':
return isFuture ? 'minuutin' : 'minuutti';
case 'mm':
result = isFuture ? 'minuutin' : 'minuuttia';
break;
case 'h':
return isFuture ? 'tunnin' : 'tunti';
case 'hh':
result = isFuture ? 'tunnin' : 'tuntia';
break;
case 'd':
return isFuture ? 'päivän' : 'päivä';
case 'dd':
result = isFuture ? 'päivän' : 'päivää';
break;
case 'M':
return isFuture ? 'kuukauden' : 'kuukausi';
case 'MM':
result = isFuture ? 'kuukauden' : 'kuukautta';
break;
case 'y':
return isFuture ? 'vuoden' : 'vuosi';
case 'yy':
result = isFuture ? 'vuoden' : 'vuotta';
break;
}
result = verbal_number(number, isFuture) + " " + result;
return result;
}
function verbal_number(number, isFuture) {
return number < 10 ? (isFuture ? numbers_future[number] : numbers_past[number]) : number;
}
var lang = {
months : "tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),
monthsShort : "tam_hel_maa_huh_tou_kes_hei_elo_syy_lok_mar_jou".split("_"),
weekdays : "sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),
weekdaysShort : "su_ma_ti_ke_to_pe_la".split("_"),
weekdaysMin : "su_ma_ti_ke_to_pe_la".split("_"),
longDateFormat : {
LT : "HH.mm",
L : "DD.MM.YYYY",
LL : "Do MMMMt\\a YYYY",
LLL : "Do MMMMt\\a YYYY, klo LT",
LLLL : "dddd, Do MMMMt\\a YYYY, klo LT"
},
calendar : {
sameDay : '[tänään] [klo] LT',
nextDay : '[huomenna] [klo] LT',
nextWeek : 'dddd [klo] LT',
lastDay : '[eilen] [klo] LT',
lastWeek : '[viime] dddd[na] [klo] LT',
sameElse : 'L'
},
relativeTime : {
future : "%s päästä",
past : "%s sitten",
s : translate,
m : translate,
mm : translate,
h : translate,
hh : translate,
d : translate,
dd : translate,
M : translate,
MM : translate,
y : translate,
yy : translate
},
ordinal : function (number) {
return ".";
}
};
// Node
if (typeof module !== 'undefined' && module.exports) {
module.exports = lang;
}
// Browser
if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
this.moment.lang('fi', lang);
}
}());

54
node_modules/emailjs/node_modules/moment/lang/fr-ca.js generated vendored Normal file
View File

@ -0,0 +1,54 @@
// moment.js language configuration
// language : canadian french (fr-ca)
// author : Jonathan Abourbih : https://github.com/jonbca
(function () {
var lang = {
months : "janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),
monthsShort : "janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),
weekdays : "dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),
weekdaysShort : "dim._lun._mar._mer._jeu._ven._sam.".split("_"),
weekdaysMin : "Di_Lu_Ma_Me_Je_Ve_Sa".split("_"),
longDateFormat : {
LT : "HH:mm",
L : "YYYY-MM-DD",
LL : "D MMMM YYYY",
LLL : "D MMMM YYYY LT",
LLLL : "dddd D MMMM YYYY LT"
},
calendar : {
sameDay: "[Aujourd'hui à] LT",
nextDay: '[Demain à] LT',
nextWeek: 'dddd [à] LT',
lastDay: '[Hier à] LT',
lastWeek: 'dddd [dernier à] LT',
sameElse: 'L'
},
relativeTime : {
future : "dans %s",
past : "il y a %s",
s : "quelques secondes",
m : "une minute",
mm : "%d minutes",
h : "une heure",
hh : "%d heures",
d : "un jour",
dd : "%d jours",
M : "un mois",
MM : "%d mois",
y : "une année",
yy : "%d années"
},
ordinal : function (number) {
return number === 1 ? 'er' : 'ème';
}
};
// Node
if (typeof module !== 'undefined' && module.exports) {
module.exports = lang;
}
// Browser
if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
this.moment.lang('fr', lang);
}
}());

54
node_modules/emailjs/node_modules/moment/lang/fr.js generated vendored Normal file
View File

@ -0,0 +1,54 @@
// moment.js language configuration
// language : french (fr)
// author : John Fischer : https://github.com/jfroffice
(function () {
var lang = {
months : "janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),
monthsShort : "janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),
weekdays : "dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),
weekdaysShort : "dim._lun._mar._mer._jeu._ven._sam.".split("_"),
weekdaysMin : "Di_Lu_Ma_Me_Je_Ve_Sa".split("_"),
longDateFormat : {
LT : "HH:mm",
L : "DD/MM/YYYY",
LL : "D MMMM YYYY",
LLL : "D MMMM YYYY LT",
LLLL : "dddd D MMMM YYYY LT"
},
calendar : {
sameDay: "[Aujourd'hui à] LT",
nextDay: '[Demain à] LT',
nextWeek: 'dddd [à] LT',
lastDay: '[Hier à] LT',
lastWeek: 'dddd [dernier à] LT',
sameElse: 'L'
},
relativeTime : {
future : "dans %s",
past : "il y a %s",
s : "quelques secondes",
m : "une minute",
mm : "%d minutes",
h : "une heure",
hh : "%d heures",
d : "un jour",
dd : "%d jours",
M : "un mois",
MM : "%d mois",
y : "une année",
yy : "%d années"
},
ordinal : function (number) {
return number === 1 ? 'er' : 'ème';
}
};
// Node
if (typeof module !== 'undefined' && module.exports) {
module.exports = lang;
}
// Browser
if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
this.moment.lang('fr', lang);
}
}());

64
node_modules/emailjs/node_modules/moment/lang/gl.js generated vendored Normal file
View File

@ -0,0 +1,64 @@
// moment.js language configuration
// language : galician (gl)
// author : Juan G. Hurtado : https://github.com/juanghurtado
(function () {
var lang = {
months : "Xaneiro_Febreiro_Marzo_Abril_Maio_Xuño_Xullo_Agosto_Setembro_Octubro_Novembro_Decembro".split("_"),
monthsShort : "Xan._Feb._Mar._Abr._Mai._Xuñ._Xul._Ago._Set._Out._Nov._Dec.".split("_"),
weekdays : "Domingo_Luns_Martes_Mércores_Xoves_Venres_Sábado".split("_"),
weekdaysShort : "Dom._Lun._Mar._Mér._Xov._Ven._Sáb.".split("_"),
weekdaysMin : "Do_Lu_Ma_Mé_Xo_Ve_Sá".split("_"),
longDateFormat : {
LT : "H:mm",
L : "DD/MM/YYYY",
LL : "D MMMM YYYY",
LLL : "D MMMM YYYY LT",
LLLL : "dddd D MMMM YYYY LT"
},
calendar : {
sameDay : function () {
return '[hoxe ' + ((this.hours() !== 1) ? 'ás' : 'a') + '] LT';
},
nextDay : function () {
return '[mañá ' + ((this.hours() !== 1) ? 'ás' : 'a') + '] LT';
},
nextWeek : function () {
return 'dddd [' + ((this.hours() !== 1) ? 'ás' : 'a') + '] LT';
},
lastDay : function () {
return '[onte ' + ((this.hours() !== 1) ? 'á' : 'a') + '] LT';
},
lastWeek : function () {
return '[o] dddd [pasado ' + ((this.hours() !== 1) ? 'ás' : 'a') + '] LT';
},
sameElse : 'L'
},
relativeTime : {
future : "en %s",
past : "fai %s",
s : "uns segundo",
m : "un minuto",
mm : "%d minutos",
h : "unha hora",
hh : "%d horas",
d : "un día",
dd : "%d días",
M : "un mes",
MM : "%d meses",
y : "un ano",
yy : "%d anos"
},
ordinal : function (number) {
return 'º';
}
};
// Node
if (typeof module !== 'undefined' && module.exports) {
module.exports = lang;
}
// Browser
if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
this.moment.lang('gl', lang);
}
}());

108
node_modules/emailjs/node_modules/moment/lang/hu.js generated vendored Normal file
View File

@ -0,0 +1,108 @@
// moment.js language configuration
// language : hungarian (hu)
// author : Adam Brunner : https://github.com/adambrunner
(function()
{
function translate(number, withoutSuffix, key, isFuture) {
var num = number;
switch (key) {
case 's':
return (isFuture || withoutSuffix) ? 'néhány másodperc' : 'néhány másodperce';
case 'm':
num = 'egy';
case 'mm':
return num + (isFuture || withoutSuffix ? ' perc' : ' perce');
break;
case 'h':
num = 'egy';
case 'hh':
return num + (isFuture || withoutSuffix ? ' óra' : ' órája');
case 'd':
num = 'egy';
case 'dd':
return num + (isFuture || withoutSuffix ? ' nap' : ' napja');
case 'M':
num = 'egy';
case 'MM':
return num + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');
case 'y':
num = 'egy';
case 'yy':
return num + (isFuture || withoutSuffix ? ' év' : ' éve');
default:
}
return '';
}
function week(isFuture) {
var ending = '';
switch (this.day()) {
case 0: ending = 'vasárnap'; break;
case 1: ending = 'hétfőn'; break;
case 2: ending = 'kedden'; break;
case 3: ending = 'szerdán'; break;
case 4: ending = 'csütörtökön'; break;
case 5: ending = 'pénteken'; break;
case 6: ending = 'szombaton'; break;
}
return (isFuture ? '' : 'múlt ')+'['+ending+'] LT[-kor]';
}
var lang = {
months : "január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),
monthsShort : "jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec".split("_"),
weekdays : "vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),
weekdaysShort : "v_h_k_sze_cs_p_szo".split("_"),
longDateFormat : {
LT : "H:mm",
L : "YYYY.MM.DD.",
LL : "YYYY. MMMM D.",
LLL : "YYYY. MMMM D., LT",
LLLL : "YYYY. MMMM D., dddd LT"
},
calendar : {
sameDay : '[ma] LT[-kor]',
nextDay : '[holnap] LT[-kor]',
nextWeek : function(){return week.call(this, true);},
lastDay : '[tegnap] LT[-kor]',
lastWeek : function(){return week.call(this, false);},
sameElse : 'L'
},
relativeTime : {
future : "%s múlva",
past : "%s",
s : translate,
m : translate,
mm : translate,
h : translate,
hh : translate,
d : translate,
dd : translate,
M : translate,
MM : translate,
y : translate,
yy : translate
},
ordinal : function(number) {
return '.';
}
};
// Node
if (typeof module !== 'undefined' && module.exports) {
module.exports = lang;
}
// Browser
if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
this.moment.lang('hu', lang);
}
}());

132
node_modules/emailjs/node_modules/moment/lang/is.js generated vendored Normal file
View File

@ -0,0 +1,132 @@
// moment.js language configuration
// language : icelandic (is)
// author : Hinrik Örn Sigurðsson : https://github.com/hinrik
(function () {
var plural = function (n) {
if (n % 100 == 11) {
return true;
} else if (n % 10 == 1) {
return false;
} else {
return true;
}
},
translate = function (number, withoutSuffix, key, isFuture) {
var result = number + " ";
switch (key) {
case 's':
return withoutSuffix || isFuture ? 'nokkrar sekúndur' : 'nokkrum sekúndum';
case 'm':
return withoutSuffix ? 'mínúta' : 'mínútu';
case 'mm':
if (plural(number)) {
return result + (withoutSuffix || isFuture ? 'mínútur' : 'mínútum');
} else if (withoutSuffix) {
return result + 'mínúta';
} else {
return result + 'mínútu';
}
case 'hh':
if (plural(number)) {
return result + (withoutSuffix || isFuture ? 'klukkustundir' : 'klukkustundum');
} else {
return result + 'klukkustund';
}
case 'd':
if (withoutSuffix) {
return 'dagur'
} else {
return isFuture ? 'dag' : 'degi';
}
case 'dd':
if (plural(number)) {
if (withoutSuffix) {
return result + 'dagar'
} else {
return result + (isFuture ? 'daga' : 'dögum');
}
} else if (withoutSuffix) {
return result + 'dagur'
} else {
return result + (isFuture ? 'dag' : 'degi');
}
case 'M':
if (withoutSuffix) {
return 'mánuður'
} else {
return isFuture ? 'mánuð' : 'mánuði';
}
case 'MM':
if (plural(number)) {
if (withoutSuffix) {
return result + 'mánuðir'
} else {
return result + (isFuture ? 'mánuði' : 'mánuðum');
}
} else if (withoutSuffix) {
return result + 'mánuður';
} else {
return result + (isFuture ? 'mánuð' : 'mánuði');
}
case 'y':
return withoutSuffix || isFuture ? 'ár' : 'ári';
case 'yy':
if (plural(number)) {
return result + (withoutSuffix || isFuture ? 'ár' : 'árum');
} else {
return result + (withoutSuffix || isFuture ? 'ár' : 'ári');
}
}
},
lang = {
months : "janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),
monthsShort : "jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),
weekdays : "sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),
weekdaysShort : "sun_mán_þri_mið_fim_fös_lau".split("_"),
weekdaysMin : "Su_Má_Þr_Mi_Fi_Fö_La".split("_"),
longDateFormat : {
LT : "H:mm",
L : "DD/MM/YYYY",
LL : "D. MMMM YYYY",
LLL : "D. MMMM YYYY kl. LT",
LLLL : "dddd, D. MMMM YYYY kl. LT"
},
calendar : {
sameDay : '[í dag kl.] LT',
nextDay : '[á morgun kl.] LT',
nextWeek : 'dddd [kl.] LT',
lastDay : '[í gær kl.] LT',
lastWeek : '[síðasta] dddd [kl.] LT',
sameElse : 'L'
},
relativeTime : {
future : "eftir %s",
past : "fyrir %s síðan",
s : translate,
m : translate,
mm : translate,
h : "klukkustund",
hh : translate,
d : translate,
dd : translate,
M : translate,
MM : translate,
y : translate,
yy : translate,
},
ordinal : function (number) {
return '.';
}
};
// Node
if (typeof module !== 'undefined' && module.exports) {
module.exports = lang;
}
// Browser
if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
this.moment.lang('is', lang);
}
}());

54
node_modules/emailjs/node_modules/moment/lang/it.js generated vendored Normal file
View File

@ -0,0 +1,54 @@
// moment.js language configuration
// language : italian (it)
// author : Lorenzo : https://github.com/aliem
(function () {
var lang = {
months : "Gennaio_Febbraio_Marzo_Aprile_Maggio_Giugno_Luglio_Agosto_Settebre_Ottobre_Novembre_Dicembre".split("_"),
monthsShort : "Gen_Feb_Mar_Apr_Mag_Giu_Lug_Ago_Set_Ott_Nov_Dic".split("_"),
weekdays : "Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato".split("_"),
weekdaysShort : "Dom_Lun_Mar_Mer_Gio_Ven_Sab".split("_"),
weekdaysMin : "D_L_Ma_Me_G_V_S".split("_"),
longDateFormat : {
LT : "HH:mm",
L : "DD/MM/YYYY",
LL : "D MMMM YYYY",
LLL : "D MMMM YYYY LT",
LLLL : "dddd, D MMMM YYYY LT"
},
calendar : {
sameDay: '[Oggi alle] LT',
nextDay: '[Domani alle] LT',
nextWeek: 'dddd [alle] LT',
lastDay: '[Ieri alle] LT',
lastWeek: '[lo scorso] dddd [alle] LT',
sameElse: 'L'
},
relativeTime : {
future : "in %s",
past : "%s fa",
s : "secondi",
m : "un minuto",
mm : "%d minuti",
h : "un'ora",
hh : "%d ore",
d : "un giorno",
dd : "%d giorni",
M : "un mese",
MM : "%d mesi",
y : "un anno",
yy : "%d anni"
},
ordinal: function () {
return 'º';
}
};
// Node
if (typeof module !== 'undefined' && module.exports) {
module.exports = lang;
}
// Browser
if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
this.moment.lang('it', lang);
}
}());

61
node_modules/emailjs/node_modules/moment/lang/ja.js generated vendored Normal file
View File

@ -0,0 +1,61 @@
// moment.js language configuration
// language : japanese (ja)
// author : LI Long : https://github.com/baryon
(function () {
var lang = {
months : "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),
monthsShort : "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),
weekdays : "日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),
weekdaysShort : "日_月_火_水_木_金_土".split("_"),
weekdaysMin : "日_月_火_水_木_金_土".split("_"),
longDateFormat : {
LT : "Ah時m分",
L : "YYYY/MM/DD",
LL : "YYYY年M月D日",
LLL : "YYYY年M月D日LT",
LLLL : "YYYY年M月D日LT dddd"
},
meridiem : function (hour, minute, isLower) {
if (hour < 12) {
return "午前";
} else {
return "午後";
}
},
calendar : {
sameDay : '[今日] LT',
nextDay : '[明日] LT',
nextWeek : '[来週]dddd LT',
lastDay : '[昨日] LT',
lastWeek : '[前週]dddd LT',
sameElse : 'L'
},
relativeTime : {
future : "%s後",
past : "%s前",
s : "数秒",
m : "1分",
mm : "%d分",
h : "1時間",
hh : "%d時間",
d : "1日",
dd : "%d日",
M : "1ヶ月",
MM : "%dヶ月",
y : "1年",
yy : "%d年"
},
ordinal : function (number) {
return '';
}
};
// Node
if (typeof module !== 'undefined' && module.exports) {
module.exports = lang;
}
// Browser
if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
this.moment.lang('ja', lang);
}
}());

64
node_modules/emailjs/node_modules/moment/lang/jp.js generated vendored Normal file
View File

@ -0,0 +1,64 @@
// moment.js language configuration
// language : japanese (jp)
// author : LI Long : https://github.com/baryon
// This language config was incorrectly named 'jp' instead of 'ja'.
// In version 2.0.0, this will be deprecated and you should use 'ja' instead.
(function () {
var lang = {
months : "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),
monthsShort : "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),
weekdays : "日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),
weekdaysShort : "日_月_火_水_木_金_土".split("_"),
weekdaysMin : "日_月_火_水_木_金_土".split("_"),
longDateFormat : {
LT : "Ah時m分",
L : "YYYY/MM/DD",
LL : "YYYY年M月D日",
LLL : "YYYY年M月D日LT",
LLLL : "YYYY年M月D日LT dddd"
},
meridiem : function (hour, minute, isLower) {
if (hour < 12) {
return "午前";
} else {
return "午後";
}
},
calendar : {
sameDay : '[今日] LT',
nextDay : '[明日] LT',
nextWeek : '[来週]dddd LT',
lastDay : '[昨日] LT',
lastWeek : '[前週]dddd LT',
sameElse : 'L'
},
relativeTime : {
future : "%s後",
past : "%s前",
s : "数秒",
m : "1分",
mm : "%d分",
h : "1時間",
hh : "%d時間",
d : "1日",
dd : "%d日",
M : "1ヶ月",
MM : "%dヶ月",
y : "1年",
yy : "%d年"
},
ordinal : function (number) {
return '';
}
};
// Node
if (typeof module !== 'undefined' && module.exports) {
module.exports = lang;
}
// Browser
if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
this.moment.lang('jp', lang);
}
}());

58
node_modules/emailjs/node_modules/moment/lang/ko.js generated vendored Normal file
View File

@ -0,0 +1,58 @@
// moment.js language configuration
// language : korean (ko)
// author : Kyungwook, Park : https://github.com/kyungw00k
(function () {
var lang = {
months : "1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),
monthsShort : "1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),
weekdays : "일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),
weekdaysShort : "일_월_화_수_목_금_토".split("_"),
weekdaysMin : "일_월_화_수_목_금_토".split("_"),
longDateFormat : {
LT : "A h시 mm분",
L : "YYYY.MM.DD",
LL : "YYYY년 MMMM D일",
LLL : "YYYY년 MMMM D일 LT",
LLLL : "YYYY년 MMMM D일 dddd LT"
},
meridiem : function (hour, minute, isUpper) {
return hour < 12 ? '오전' : '오후';
},
calendar : {
sameDay : '오늘 LT',
nextDay : '내일 LT',
nextWeek : 'dddd LT',
lastDay : '어제 LT',
lastWeek : '지난주 dddd LT',
sameElse : 'L'
},
relativeTime : {
future : "%s 후",
past : "%s 전",
s : "몇초",
ss : "%d초",
m : "일분",
mm : "%d분",
h : "한시간",
hh : "%d시간",
d : "하루",
dd : "%d일",
M : "한달",
MM : "%d달",
y : "일년",
yy : "%d년"
},
ordinal : function (number) {
return '일';
}
};
// Node
if (typeof module !== 'undefined' && module.exports) {
module.exports = lang;
}
// Browser
if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
this.moment.lang('ko', lang);
}
}());

61
node_modules/emailjs/node_modules/moment/lang/kr.js generated vendored Normal file
View File

@ -0,0 +1,61 @@
// moment.js language configuration
// language : korean (kr)
// author : Kyungwook, Park : https://github.com/kyungw00k
// This language config was incorrectly named 'kr' instead of 'ko'.
// In version 2.0.0, this will be deprecated and you should use 'ko' instead.
(function () {
var lang = {
months : "1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),
monthsShort : "1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),
weekdays : "일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),
weekdaysShort : "일_월_화_수_목_금_토".split("_"),
weekdaysMin : "일_월_화_수_목_금_토".split("_"),
longDateFormat : {
LT : "A h시 mm분",
L : "YYYY.MM.DD",
LL : "YYYY년 MMMM D일",
LLL : "YYYY년 MMMM D일 LT",
LLLL : "YYYY년 MMMM D일 dddd LT"
},
meridiem : function (hour, minute, isUpper) {
return hour < 12 ? '오전' : '오후';
},
calendar : {
sameDay : '오늘 LT',
nextDay : '내일 LT',
nextWeek : 'dddd LT',
lastDay : '어제 LT',
lastWeek : '지난주 dddd LT',
sameElse : 'L'
},
relativeTime : {
future : "%s 후",
past : "%s 전",
s : "몇초",
ss : "%d초",
m : "일분",
mm : "%d분",
h : "한시간",
hh : "%d시간",
d : "하루",
dd : "%d일",
M : "한달",
MM : "%d달",
y : "일년",
yy : "%d년"
},
ordinal : function (number) {
return '일';
}
};
// Node
if (typeof module !== 'undefined' && module.exports) {
module.exports = lang;
}
// Browser
if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
this.moment.lang('kr', lang);
}
}());

54
node_modules/emailjs/node_modules/moment/lang/nb.js generated vendored Normal file
View File

@ -0,0 +1,54 @@
// moment.js language configuration
// language : norwegian bokmål (nb)
// author : Espen Hovlandsdal : https://github.com/rexxars
(function () {
var lang = {
months : "januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),
monthsShort : "jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),
weekdays : "søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),
weekdaysShort : "søn_man_tir_ons_tor_fre_lør".split("_"),
weekdaysMin : "sø_ma_ti_on_to_fr_lø".split("_"),
longDateFormat : {
LT : "HH:mm",
L : "YYYY-MM-DD",
LL : "D MMMM YYYY",
LLL : "D MMMM YYYY LT",
LLLL : "dddd D MMMM YYYY LT"
},
calendar : {
sameDay: '[I dag klokken] LT',
nextDay: '[I morgen klokken] LT',
nextWeek: 'dddd [klokken] LT',
lastDay: '[I går klokken] LT',
lastWeek: '[Forrige] dddd [klokken] LT',
sameElse: 'L'
},
relativeTime : {
future : "om %s",
past : "for %s siden",
s : "noen sekunder",
m : "ett minutt",
mm : "%d minutter",
h : "en time",
hh : "%d timer",
d : "en dag",
dd : "%d dager",
M : "en måned",
MM : "%d måneder",
y : "ett år",
yy : "%d år"
},
ordinal : function (number) {
return '.';
}
};
// Node
if (typeof module !== 'undefined' && module.exports) {
module.exports = lang;
}
// Browser
if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
this.moment.lang('nb', lang);
}
}());

62
node_modules/emailjs/node_modules/moment/lang/nl.js generated vendored Normal file
View File

@ -0,0 +1,62 @@
// moment.js language configuration
// language : dutch (nl)
// author : Joris Röling : https://github.com/jjupiter
(function () {
var monthsShortWithDots = "jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_");
var monthsShortWithoutDots = "jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_");
var lang = {
months : "januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),
monthsShort : function (m, format) {
if (/-MMM-/.test(format)) {
return monthsShortWithoutDots[m.month()];
} else {
return monthsShortWithDots[m.month()];
}
},
weekdays : "zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),
weekdaysShort : "zo._ma._di._wo._do._vr._za.".split("_"),
weekdaysMin : "Zo_Ma_Di_Wo_Do_Vr_Za".split("_"),
longDateFormat : {
LT : "HH:mm",
L : "DD-MM-YYYY",
LL : "D MMMM YYYY",
LLL : "D MMMM YYYY LT",
LLLL : "dddd D MMMM YYYY LT"
},
calendar : {
sameDay: '[Vandaag om] LT',
nextDay: '[Morgen om] LT',
nextWeek: 'dddd [om] LT',
lastDay: '[Gisteren om] LT',
lastWeek: '[afgelopen] dddd [om] LT',
sameElse: 'L'
},
relativeTime : {
future : "over %s",
past : "%s geleden",
s : "een paar seconden",
m : "één minuut",
mm : "%d minuten",
h : "één uur",
hh : "%d uur",
d : "één dag",
dd : "%d dagen",
M : "één maand",
MM : "%d maanden",
y : "één jaar",
yy : "%d jaar"
},
ordinal : function (number) {
return (number === 1 || number === 8 || number >= 20) ? 'ste' : 'de';
}
};
// Node
if (typeof module !== 'undefined' && module.exports) {
module.exports = lang;
}
// Browser
if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
this.moment.lang('nl', lang);
}
}());

76
node_modules/emailjs/node_modules/moment/lang/pl.js generated vendored Normal file
View File

@ -0,0 +1,76 @@
// moment.js language configuration
// language : polish (pl)
// author : Rafal Hirsz : https://github.com/evoL
(function () {
var plural = function (n) {
return (n % 10 < 5) && (n % 10 > 1) && (~~(n / 10) !== 1);
},
translate = function (number, withoutSuffix, key) {
var result = number + " ";
switch (key) {
case 'm':
return withoutSuffix ? 'minuta' : 'minutę';
case 'mm':
return result + (plural(number) ? 'minuty' : 'minut');
case 'h':
return withoutSuffix ? 'godzina' : 'godzinę';
case 'hh':
return result + (plural(number) ? 'godziny' : 'godzin');
case 'MM':
return result + (plural(number) ? 'miesiące' : 'miesięcy');
case 'yy':
return result + (plural(number) ? 'lata' : 'lat');
}
},
lang = {
months : "styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),
monthsShort : "sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),
weekdays : "niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),
weekdaysShort : "nie_pon_wt_śr_czw_pt_sb".split("_"),
weekdaysMin : "N_Pn_Wt_Śr_Cz_Pt_So".split("_"),
longDateFormat : {
LT : "HH:mm",
L : "DD-MM-YYYY",
LL : "D MMMM YYYY",
LLL : "D MMMM YYYY LT",
LLLL : "dddd, D MMMM YYYY LT"
},
calendar : {
sameDay: '[Dziś o] LT',
nextDay: '[Jutro o] LT',
nextWeek: '[W] dddd [o] LT',
lastDay: '[Wczoraj o] LT',
lastWeek: '[W zeszły/łą] dddd [o] LT',
sameElse: 'L'
},
relativeTime : {
future : "za %s",
past : "%s temu",
s : "kilka sekund",
m : translate,
mm : translate,
h : translate,
hh : translate,
d : "1 dzień",
dd : '%d dni',
M : "miesiąc",
MM : translate,
y : "rok",
yy : translate
},
ordinal : function (number) {
return '.';
}
};
// Node
if (typeof module !== 'undefined' && module.exports) {
module.exports = lang;
}
// Browser
if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
this.moment.lang('pl', lang);
}
}());

58
node_modules/emailjs/node_modules/moment/lang/pt-br.js generated vendored Normal file
View File

@ -0,0 +1,58 @@
// moment.js language configuration
// language : brazilian portuguese (pt-br)
// author : Caio Ribeiro Pereira : https://github.com/caio-ribeiro-pereira
(function () {
var lang = {
months : "Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),
monthsShort : "Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),
weekdays : "Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),
weekdaysShort : "Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),
weekdaysMin : "Dom_2ª_3ª_4ª_5ª_6ª_Sáb".split("_"),
longDateFormat : {
LT : "HH:mm",
L : "DD/MM/YYYY",
LL : "D \\de MMMM \\de YYYY",
LLL : "D \\de MMMM \\de YYYY LT",
LLLL : "dddd, D \\de MMMM \\de YYYY LT"
},
calendar : {
sameDay: '[Hoje às] LT',
nextDay: '[Amanhã às] LT',
nextWeek: 'dddd [às] LT',
lastDay: '[Ontem às] LT',
lastWeek: function () {
return (this.day() === 0 || this.day() === 6) ?
'[Último] dddd [às] LT' : // Saturday + Sunday
'[Última] dddd [às] LT'; // Monday - Friday
},
sameElse: 'L'
},
relativeTime : {
future : "em %s",
past : "%s atrás",
s : "segundos",
m : "um minuto",
mm : "%d minutos",
h : "uma hora",
hh : "%d horas",
d : "um dia",
dd : "%d dias",
M : "um mês",
MM : "%d meses",
y : "um ano",
yy : "%d anos"
},
ordinal : function (number) {
return 'º';
}
};
// Node
if (typeof module !== 'undefined' && module.exports) {
module.exports = lang;
}
// Browser
if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
this.moment.lang('pt-br', lang);
}
}());

58
node_modules/emailjs/node_modules/moment/lang/pt.js generated vendored Normal file
View File

@ -0,0 +1,58 @@
// moment.js language configuration
// language : portuguese (pt)
// author : Jefferson : https://github.com/jalex79
(function () {
var lang = {
months : "Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),
monthsShort : "Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),
weekdays : "Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),
weekdaysShort : "Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),
weekdaysMin : "Dom_2ª_3ª_4ª_5ª_6ª_Sáb".split("_"),
longDateFormat : {
LT : "HH:mm",
L : "DD/MM/YYYY",
LL : "D \\de MMMM \\de YYYY",
LLL : "D \\de MMMM \\de YYYY LT",
LLLL : "dddd, D \\de MMMM \\de YYYY LT"
},
calendar : {
sameDay: '[Hoje às] LT',
nextDay: '[Amanhã às] LT',
nextWeek: 'dddd [às] LT',
lastDay: '[Ontem às] LT',
lastWeek: function () {
return (this.day() === 0 || this.day() === 6) ?
'[Último] dddd [às] LT' : // Saturday + Sunday
'[Última] dddd [às] LT'; // Monday - Friday
},
sameElse: 'L'
},
relativeTime : {
future : "em %s",
past : "%s atrás",
s : "segundos",
m : "um minuto",
mm : "%d minutos",
h : "uma hora",
hh : "%d horas",
d : "um dia",
dd : "%d dias",
M : "um mês",
MM : "%d meses",
y : "um ano",
yy : "%d anos"
},
ordinal : function (number) {
return 'º';
}
};
// Node
if (typeof module !== 'undefined' && module.exports) {
module.exports = lang;
}
// Browser
if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
this.moment.lang('pt', lang);
}
}());

133
node_modules/emailjs/node_modules/moment/lang/ru.js generated vendored Normal file
View File

@ -0,0 +1,133 @@
// moment.js language configuration
// language : russian (ru)
// author : Viktorminator : https://github.com/Viktorminator
(function () {
var pluralRules = [
function (n) { return ((n % 10 === 1) && (n % 100 !== 11)); },
function (n) { return ((n % 10) >= 2 && (n % 10) <= 4 && ((n % 10) % 1) === 0) && ((n % 100) < 12 || (n % 100) > 14); },
function (n) { return ((n % 10) === 0 || ((n % 10) >= 5 && (n % 10) <= 9 && ((n % 10) % 1) === 0) || ((n % 100) >= 11 && (n % 100) <= 14 && ((n % 100) % 1) === 0)); },
function (n) { return true; }
],
plural = function (word, num) {
var forms = word.split('_'),
minCount = Math.min(pluralRules.length, forms.length),
i = -1;
while (++i < minCount) {
if (pluralRules[i](num)) {
return forms[i];
}
}
return forms[minCount - 1];
},
relativeTimeWithPlural = function (number, withoutSuffix, key) {
var format = {
'mm': 'минута_минуты_минут_минуты',
'hh': асасаасов_часа',
'dd': ень_дня_дней_дня',
'MM': есяц_месяцаесяцев_месяца',
'yy': 'год_годает_года'
};
if (key === 'm') {
return withoutSuffix ? 'минута' : 'минуту';
}
else {
return number + ' ' + plural(format[key], +number);
}
},
monthsCaseReplace = function (m, format) {
var months = {
'nominative': 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'),
'accusative': 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_')
},
nounCase = (/D[oD]? *MMMM?/).test(format) ?
'accusative' :
'nominative';
return months[nounCase][m.month()];
},
weekdaysCaseReplace = function (m, format) {
var weekdays = {
'nominative': оскресенье_понедельник_вторник_средаетверг_пятница_суббота'.split('_'),
'accusative': оскресенье_понедельник_вторник_средуетверг_пятницу_субботу'.split('_'),
},
nounCase = (/\[ ?[Вв] ?(?:прошлую|следующую)? ?\] ?dddd/).test(format) ?
'accusative' :
'nominative';
return weekdays[nounCase][m.day()];
},
lang = {
months : monthsCaseReplace,
monthsShort : "янв_фев_мар_апрай_июн_июл_авг_сен_окт_ноя_дек".split("_"),
weekdays : weekdaysCaseReplace,
weekdaysShort : ск_пнд_втр_срд_чтв_птн_сбт".split("_"),
weekdaysMin : с_пн_вт_ср_чт_пт_сб".split("_"),
longDateFormat : {
LT : "HH:mm",
L : "DD.MM.YYYY",
LL : "D MMMM YYYY г.",
LLL : "D MMMM YYYY г., LT",
LLLL : "dddd, D MMMM YYYY г., LT"
},
calendar : {
sameDay: '[Сегодня в] LT',
nextDay: '[Завтра в] LT',
lastDay: '[Вчера в] LT',
nextWeek: function () {
return this.day() === 2 ? '[Во] dddd [в] LT' : '[В] dddd [в] LT';
},
lastWeek: function () {
switch (this.day()) {
case 0:
return '[В прошлое] dddd [в] LT';
case 1:
case 2:
case 4:
return '[В прошлый] dddd [в] LT';
case 3:
case 5:
case 6:
return '[В прошлую] dddd [в] LT';
}
},
sameElse: 'L'
},
// It needs checking (adding) russian plurals and cases.
relativeTime : {
future : "через %s",
past : "%s назад",
s : "несколько секунд",
m : relativeTimeWithPlural,
mm : relativeTimeWithPlural,
h : "час",
hh : relativeTimeWithPlural,
d : "день",
dd : relativeTimeWithPlural,
M : "месяц",
MM : relativeTimeWithPlural,
y : "год",
yy : relativeTimeWithPlural
},
ordinal : function (number) {
return '.';
}
};
// Node
if (typeof module !== 'undefined' && module.exports) {
module.exports = lang;
}
// Browser
if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
this.moment.lang('ru', lang);
}
}());

58
node_modules/emailjs/node_modules/moment/lang/sv.js generated vendored Normal file
View File

@ -0,0 +1,58 @@
// moment.js language configuration
// language : swedish (sv)
// author : Jens Alm : https://github.com/ulmus
(function () {
var lang = {
months : "januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),
monthsShort : "jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),
weekdays : "söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),
weekdaysShort : "sön_mån_tis_ons_tor_fre_lör".split("_"),
weekdaysMin : "sö_må_ti_on_to_fr_lö".split("_"),
longDateFormat : {
LT : "HH:mm",
L : "YYYY-MM-DD",
LL : "D MMMM YYYY",
LLL : "D MMMM YYYY LT",
LLLL : "dddd D MMMM YYYY LT"
},
calendar : {
sameDay: '[Idag klockan] LT',
nextDay: '[Imorgon klockan] LT',
lastDay: '[Igår klockan] LT',
nextWeek: 'dddd [klockan] LT',
lastWeek: '[Förra] dddd[en klockan] LT',
sameElse: 'L'
},
relativeTime : {
future : "om %s",
past : "för %s sen",
s : "några sekunder",
m : "en minut",
mm : "%d minuter",
h : "en timme",
hh : "%d timmar",
d : "en dag",
dd : "%d dagar",
M : "en månad",
MM : "%d månader",
y : "ett år",
yy : "%d år"
},
ordinal : function (number) {
var b = number % 10;
return (~~ (number % 100 / 10) === 1) ? 'e' :
(b === 1) ? 'a' :
(b === 2) ? 'a' :
(b === 3) ? 'e' : 'e';
}
};
// Node
if (typeof module !== 'undefined' && module.exports) {
module.exports = lang;
}
// Browser
if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
this.moment.lang('sv', lang);
}
}());

88
node_modules/emailjs/node_modules/moment/lang/tr.js generated vendored Normal file
View File

@ -0,0 +1,88 @@
// moment.js language configuration
// language : turkish (tr)
// authors : Erhan Gundogan : https://github.com/erhangundogan,
// Burak Yiğit Kaya: https://github.com/BYK
(function () {
var suffixes = {
1: "'inci",
5: "'inci",
8: "'inci",
70: "'inci",
80: "'inci",
2: "'nci",
7: "'nci",
20: "'nci",
50: "'nci",
3: "'üncü",
4: "'üncü",
100: "'üncü",
6: "'ncı",
9: "'uncu",
10: "'uncu",
30: "'uncu",
60: "'ıncı",
90: "'ıncı"
};
var lang = {
months : "Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),
monthsShort : "Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),
weekdays : "Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),
weekdaysShort : "Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),
weekdaysMin : "Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),
longDateFormat : {
LT : "HH:mm",
L : "DD.MM.YYYY",
LL : "D MMMM YYYY",
LLL : "D MMMM YYYY LT",
LLLL : "dddd, D MMMM YYYY LT"
},
calendar : {
sameDay : '[bugün saat] LT',
nextDay : '[yarın saat] LT',
nextWeek : '[haftaya] dddd [saat] LT',
lastDay : '[dün] LT',
lastWeek : '[geçen hafta] dddd [saat] LT',
sameElse : 'L'
},
relativeTime : {
future : "%s sonra",
past : "%s önce",
s : "birkaç saniye",
m : "bir dakika",
mm : "%d dakika",
h : "bir saat",
hh : "%d saat",
d : "bir gün",
dd : "%d gün",
M : "bir ay",
MM : "%d ay",
y : "bir yıl",
yy : "%d yıl"
},
ordinal : function (number) {
if (number === 0) { // special case for zero
return "'ıncı";
}
var a = number % 10;
var b = number % 100 - a;
var c = number >= 100 ? 100 : null;
return suffixes[a] || suffixes[b] || suffixes[c];
}
};
// Node
if (typeof module !== 'undefined' && module.exports) {
module.exports = lang;
}
// Browser
if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
this.moment.lang('tr', lang);
}
}());

67
node_modules/emailjs/node_modules/moment/lang/zh-cn.js generated vendored Normal file
View File

@ -0,0 +1,67 @@
// moment.js language configuration
// language : chinese
// author : suupic : https://github.com/suupic
(function () {
var lang = {
months : "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),
monthsShort : "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),
weekdays : "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),
weekdaysShort : "周日_周一_周二_周三_周四_周五_周六".split("_"),
weekdaysMin : "日_一_二_三_四_五_六".split("_"),
longDateFormat : {
LT : "Ah点mm",
L : "YYYY年MMMD日",
LL : "YYYY年MMMD日",
LLL : "YYYY年MMMD日LT",
LLLL : "YYYY年MMMD日ddddLT"
},
meridiem : function (hour, minute, isLower) {
if (hour < 9) {
return "早上";
} else if (hour < 11 && minute < 30) {
return "上午";
} else if (hour < 13 && minute < 30) {
return "中午";
} else if (hour < 18) {
return "下午";
} else {
return "晚上";
}
},
calendar : {
sameDay : '[今天]LT',
nextDay : '[明天]LT',
nextWeek : '[下]ddddLT',
lastDay : '[昨天]LT',
lastWeek : '[上]ddddLT',
sameElse : 'L'
},
relativeTime : {
future : "%s内",
past : "%s前",
s : "几秒",
m : "1分钟",
mm : "%d分钟",
h : "1小时",
hh : "%d小时",
d : "1天",
dd : "%d天",
M : "1个月",
MM : "%d个月",
y : "1年",
yy : "%d年"
},
ordinal : function (number) {
return '';
}
};
// Node
if (typeof module !== 'undefined' && module.exports) {
module.exports = lang;
}
// Browser
if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
this.moment.lang('zh-cn', lang);
}
}());

67
node_modules/emailjs/node_modules/moment/lang/zh-tw.js generated vendored Normal file
View File

@ -0,0 +1,67 @@
// moment.js language configuration
// language : traditional chinese (zh-tw)
// author : Ben : https://github.com/ben-lin
(function () {
var lang = {
months : "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),
monthsShort : "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),
weekdays : "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),
weekdaysShort : "週日_週一_週二_週三_週四_週五_週六".split("_"),
weekdaysMin : "日_一_二_三_四_五_六".split("_"),
longDateFormat : {
LT : "Ah點mm",
L : "YYYY年MMMD日",
LL : "YYYY年MMMD日",
LLL : "YYYY年MMMD日LT",
LLLL : "YYYY年MMMD日ddddLT"
},
meridiem : function (hour, minute, isLower) {
if (hour < 9) {
return "早上";
} else if (hour < 11 && minute < 30) {
return "上午";
} else if (hour < 13 && minute < 30) {
return "中午";
} else if (hour < 18) {
return "下午";
} else {
return "晚上";
}
},
calendar : {
sameDay : '[今天]LT',
nextDay : '[明天]LT',
nextWeek : '[下]ddddLT',
lastDay : '[昨天]LT',
lastWeek : '[上]ddddLT',
sameElse : 'L'
},
relativeTime : {
future : "%s內",
past : "%s前",
s : "幾秒",
m : "一分鐘",
mm : "%d分鐘",
h : "一小時",
hh : "%d小時",
d : "一天",
dd : "%d天",
M : "一個月",
MM : "%d個月",
y : "一年",
yy : "%d年"
},
ordinal : function (number) {
return '';
}
};
// Node
if (typeof module !== 'undefined' && module.exports) {
module.exports = lang;
}
// Browser
if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
this.moment.lang('zh-tw', lang);
}
}());

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,4 @@
// moment.js language configuration
// language : bulgarian (bg)
// author : Krasen Borisov : https://github.com/kraz
(function(){var a={months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"янрев_мар_апрай_юни_юли_авг_сеп_окт_ноеек".split("_"),weekdays:еделя_понеделник_вторник_срядаетвъртък_петък_събота".split("_"),weekdaysShort:ед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"h:mm",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[В изминалата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[В изминалия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дни",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},ordinal:function(a){return"."}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("bg",a)})();

View File

@ -0,0 +1,4 @@
// moment.js language configuration
// language : catalan (ca)
// author : Juan G. Hurtado : https://github.com/juanghurtado
(function(){var a={months:"Gener_Febrer_Març_Abril_Maig_Juny_Juliol_Agost_Setembre_Octubre_Novembre_Desembre".split("_"),monthsShort:"Gen._Febr._Mar._Abr._Mai._Jun._Jul._Ag._Set._Oct._Nov._Des.".split("_"),weekdays:"Diumenge_Dilluns_Dimarts_Dimecres_Dijous_Divendres_Dissabte".split("_"),weekdaysShort:"Dg._Dl._Dt._Dc._Dj._Dv._Ds.".split("_"),weekdaysMin:"Dg_Dl_Dt_Dc_Dj_Dv_Ds".split("_"),longDateFormat:{LT:"H:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:function(){return"[avui a "+(this.hours()!==1?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(this.hours()!==1?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(this.hours()!==1?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(this.hours()!==1?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(this.hours()!==1?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"fa %s",s:"uns segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},ordinal:function(a){return"º"}};typeof module!="undefined"&&module.exports&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("ca",a)})();

View File

@ -0,0 +1,4 @@
// moment.js language configuration
// language : chuvash (cv)
// author : Anatoly Mironov : https://github.com/mirontoli
(function(){var a={months:"кăрлач_нарăс_пуш_акаай_çĕртме_утă_çурла_авăн_юпа_чӳк_раштав".split("_"),monthsShort:"кăрар_пуш_акаай_çĕр_утă_çур_ав_юпа_чӳк_раш".split("_"),weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кĕçнерникун_эрнекун_шăматкун".split("_"),weekdaysShort:"вырун_ытл_юн_кĕç_эрн_шăм".split("_"),weekdaysMin:р_тн_ыт_юн_кç_эр_шм".split("_"),longDateFormat:{LT:"HH:mm",L:"DD-MM-YYYY",LL:"YYYY çулхи MMMM уйăхĕн D-мĕшĕ",LLL:"YYYY çулхи MMMM уйăхĕн D-мĕшĕ, LT",LLLL:"dddd, YYYY çулхи MMMM уйăхĕн D-мĕшĕ, LT"},calendar:{sameDay:"[Паян] LT [сехетре]",nextDay:"[Ыран] LT [сехетре]",lastDay:"[Ĕнер] LT [сехетре]",nextWeek:"[Çитес] dddd LT [сехетре]",lastWeek:"[Иртнĕ] dddd LT [сехетре]",sameElse:"L"},relativeTime:{future:"%sран",past:"%s каялла",s:"пĕр-ик çеккунт",m:"пĕр минут",mm:"%d минут",h:"пĕр сехет",hh:"%d сехет",d:"пĕр кун",dd:"%d кун",M:"пĕр уйăх",MM:"%d уйăх",y:"пĕр çул",yy:"%d çул"},ordinal:function(a){return"-мĕш"}};typeof module!="undefined"&&module.exports&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("cv",a)})();

View File

@ -0,0 +1,4 @@
// moment.js language configuration
// language : danish (da)
// author : Ulrik Nielsen : https://github.com/mrbase
(function(){var a={months:"Januar_Februar_Marts_April_Maj_Juni_Juli_August_September_Oktober_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Maj_Jun_Jul_Aug_Sep_Okt_Nov_Dec".split("_"),weekdays:"Søndag_Mandag_Tirsdag_Onsdag_Torsdag_Fredag_Lørdag".split("_"),weekdaysShort:"Søn_Man_Tir_Ons_Tor_Fre_Lør".split("_"),weekdaysMin:"Sø_Ma_Ti_On_To_Fr_Lø".split("_"),longDateFormat:{LT:"h:mm A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd D. MMMM, YYYY h:mm A"},calendar:{sameDay:"[I dag kl.] LT",nextDay:"[I morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[I går kl.] LT",lastWeek:"[sidste] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",m:"minut",mm:"%d minutter",h:"time",hh:"%d timer",d:"dag",dd:"%d dage",M:"månede",MM:"%d måneder",y:"år",yy:"%d år"},ordinal:function(a){return"."}};typeof module!="undefined"&&module.exports&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("da",a)})();

View File

@ -0,0 +1,4 @@
// moment.js language configuration
// language : german (de)
// author : lluchs : https://github.com/lluchs
(function(){var a={months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),longDateFormat:{LT:"H:mm U\\hr",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd, D. MMMM YYYY LT"},calendar:{sameDay:"[Heute um] LT",sameElse:"L",nextDay:"[Morgen um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gestern um] LT",lastWeek:"[letzten] dddd [um] LT"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:"einer Minute",mm:"%d Minuten",h:"einer Stunde",hh:"%d Stunden",d:"einem Tag",dd:"%d Tagen",M:"einem Monat",MM:"%d Monaten",y:"einem Jahr",yy:"%d Jahren"},ordinal:function(a){return"."}};typeof module!="undefined"&&module.exports&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("de",a)})();

View File

@ -0,0 +1,4 @@
// moment.js language configuration
// language : canadian english (en-ca)
// author : Jonathan Abourbih : https://github.com/jonbca
(function(){var a={months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",L:"YYYY-MM-DD",LL:"D MMMM, YYYY",LLL:"D MMMM, YYYY LT",LLLL:"dddd, D MMMM, YYYY LT"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinal:function(a){var b=a%10;return~~(a%100/10)===1?"th":b===1?"st":b===2?"nd":b===3?"rd":"th"}};typeof module!="undefined"&&module.exports&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("en-gb",a)})();

View File

@ -0,0 +1,4 @@
// moment.js language configuration
// language : great britain english (en-gb)
// author : Chris Gedrim : https://github.com/chrisgedrim
(function(){var a={months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinal:function(a){var b=a%10;return~~(a%100/10)===1?"th":b===1?"st":b===2?"nd":b===3?"rd":"th"}};typeof module!="undefined"&&module.exports&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("en-gb",a)})();

View File

@ -0,0 +1,4 @@
// moment.js language configuration
// language : spanish (es)
// author : Julio Napurí : https://github.com/julionc
(function(){var a={months:"Enero_Febrero_Marzo_Abril_Mayo_Junio_Julio_Agosto_Septiembre_Octubre_Noviembre_Diciembre".split("_"),monthsShort:"Ene._Feb._Mar._Abr._May._Jun._Jul._Ago._Sep._Oct._Nov._Dic.".split("_"),weekdays:"Domingo_Lunes_Martes_Miércoles_Jueves_Viernes_Sábado".split("_"),weekdaysShort:"Dom._Lun._Mar._Mié._Jue._Vie._Sáb.".split("_"),weekdaysMin:"Do_Lu_Ma_Mi_Ju_Vi_Sá".split("_"),longDateFormat:{LT:"H:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:function(){return"[hoy a la"+(this.hours()!==1?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(this.hours()!==1?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(this.hours()!==1?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(this.hours()!==1?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(this.hours()!==1?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(a){return"º"}};typeof module!="undefined"&&module.exports&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("es",a)})();

View File

@ -0,0 +1,4 @@
// moment.js language configuration
// language : euskara (eu)
// author : Eneko Illarramendi : https://github.com/eillarra
(function(){var a={months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),longDateFormat:{LT:"HH:mm",L:"YYYY-MM-DD",LL:"YYYYko MMMMren D[a]",LLL:"YYYYko MMMMren D[a] LT",LLLL:"dddd, YYYYko MMMMren D[a] LT"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},ordinal:function(a){return"."}};typeof module!="undefined"&&module.exports&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("eu",a)})();

View File

@ -0,0 +1,4 @@
// moment.js language configuration
// language : finnish (fi)
// author : Tarmo Aidantausta : https://github.com/bleadof
(function(){function c(a,b,c,e){var f="";switch(c){case"s":return e?"muutaman sekunnin":"muutama sekunti";case"m":return e?"minuutin":"minuutti";case"mm":f=e?"minuutin":"minuuttia";break;case"h":return e?"tunnin":"tunti";case"hh":f=e?"tunnin":"tuntia";break;case"d":return e?"päivän":"päivä";case"dd":f=e?"päivän":"päivää";break;case"M":return e?"kuukauden":"kuukausi";case"MM":f=e?"kuukauden":"kuukautta";break;case"y":return e?"vuoden":"vuosi";case"yy":f=e?"vuoden":"vuotta"}return f=d(a,e)+" "+f,f}function d(c,d){return c<10?d?b[c]:a[c]:c}var a=["nolla","yksi","kaksi","kolme","neljä","viisi","kuusi","seitsemän","kahdeksan","yhdeksän"],b=["nolla","yhden","kahden","kolmen","neljän","viiden","kuuden",a[7],a[8],a[9]],e={months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tam_hel_maa_huh_tou_kes_hei_elo_syy_lok_mar_jou".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",L:"DD.MM.YYYY",LL:"Do MMMMt\\a YYYY",LLL:"Do MMMMt\\a YYYY, klo LT",LLLL:"dddd, Do MMMMt\\a YYYY, klo LT"},calendar:{sameDay:"[tänään] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s päästä",past:"%s sitten",s:c,m:c,mm:c,h:c,hh:c,d:c,dd:c,M:c,MM:c,y:c,yy:c},ordinal:function(a){return"."}};typeof module!="undefined"&&module.exports&&(module.exports=e),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("fi",e)})();

View File

@ -0,0 +1,4 @@
// moment.js language configuration
// language : canadian french (fr-ca)
// author : Jonathan Abourbih : https://github.com/jonbca
(function(){var a={months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Je_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"une année",yy:"%d années"},ordinal:function(a){return a===1?"er":"ème"}};typeof module!="undefined"&&module.exports&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("fr",a)})();

View File

@ -0,0 +1,4 @@
// moment.js language configuration
// language : french (fr)
// author : John Fischer : https://github.com/jfroffice
(function(){var a={months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Je_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"une année",yy:"%d années"},ordinal:function(a){return a===1?"er":"ème"}};typeof module!="undefined"&&module.exports&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("fr",a)})();

View File

@ -0,0 +1,4 @@
// moment.js language configuration
// language : galician (gl)
// author : Juan G. Hurtado : https://github.com/juanghurtado
(function(){var a={months:"Xaneiro_Febreiro_Marzo_Abril_Maio_Xuño_Xullo_Agosto_Setembro_Octubro_Novembro_Decembro".split("_"),monthsShort:"Xan._Feb._Mar._Abr._Mai._Xuñ._Xul._Ago._Set._Out._Nov._Dec.".split("_"),weekdays:"Domingo_Luns_Martes_Mércores_Xoves_Venres_Sábado".split("_"),weekdaysShort:"Dom._Lun._Mar._Mér._Xov._Ven._Sáb.".split("_"),weekdaysMin:"Do_Lu_Ma_Mé_Xo_Ve_Sá".split("_"),longDateFormat:{LT:"H:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:function(){return"[hoxe "+(this.hours()!==1?"ás":"a")+"] LT"},nextDay:function(){return"[mañá "+(this.hours()!==1?"ás":"a")+"] LT"},nextWeek:function(){return"dddd ["+(this.hours()!==1?"ás":"a")+"] LT"},lastDay:function(){return"[onte "+(this.hours()!==1?"á":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(this.hours()!==1?"ás":"a")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"fai %s",s:"uns segundo",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},ordinal:function(a){return"º"}};typeof module!="undefined"&&module.exports&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("gl",a)})();

View File

@ -0,0 +1,4 @@
// moment.js language configuration
// language : hungarian (hu)
// author : Adam Brunner : https://github.com/adambrunner
(function(){function a(a,b,c,d){var e=a;switch(c){case"s":return d||b?"néhány másodperc":"néhány másodperce";case"m":e="egy";case"mm":return e+(d||b?" perc":" perce");case"h":e="egy";case"hh":return e+(d||b?" óra":" órája");case"d":e="egy";case"dd":return e+(d||b?" nap":" napja");case"M":e="egy";case"MM":return e+(d||b?" hónap":" hónapja");case"y":e="egy";case"yy":return e+(d||b?" év":" éve");default:}return""}function b(a){var b="";switch(this.day()){case 0:b="vasárnap";break;case 1:b="hétfőn";break;case 2:b="kedden";break;case 3:b="szerdán";break;case 4:b="csütörtökön";break;case 5:b="pénteken";break;case 6:b="szombaton"}return(a?"":"múlt ")+"["+b+"] LT[-kor]"}var c={months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec".split("_"),weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D., LT",LLLL:"YYYY. MMMM D., dddd LT"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return b.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return b.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:a,m:a,mm:a,h:a,hh:a,d:a,dd:a,M:a,MM:a,y:a,yy:a},ordinal:function(a){return"."}};typeof module!="undefined"&&module.exports&&(module.exports=c),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("hu",c)})();

View File

@ -0,0 +1,4 @@
// moment.js language configuration
// language : icelandic (is)
// author : Hinrik Örn Sigurðsson : https://github.com/hinrik
(function(){var a=function(a){return a%100==11?!0:a%10==1?!1:!0},b=function(b,c,d,e){var f=b+" ";switch(d){case"s":return c||e?"nokkrar sekúndur":"nokkrum sekúndum";case"m":return c?"mínúta":"mínútu";case"mm":return a(b)?f+(c||e?"mínútur":"mínútum"):c?f+"mínúta":f+"mínútu";case"hh":return a(b)?f+(c||e?"klukkustundir":"klukkustundum"):f+"klukkustund";case"d":return c?"dagur":e?"dag":"degi";case"dd":return a(b)?c?f+"dagar":f+(e?"daga":"dögum"):c?f+"dagur":f+(e?"dag":"degi");case"M":return c?"mánuður":e?"mánuð":"mánuði";case"MM":return a(b)?c?f+"mánuðir":f+(e?"mánuði":"mánuðum"):c?f+"mánuður":f+(e?"mánuð":"mánuði");case"y":return c||e?"ár":"ári";case"yy":return a(b)?f+(c||e?"ár":"árum"):f+(c||e?"ár":"ári")}},c={months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),longDateFormat:{LT:"H:mm",L:"DD/MM/YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY kl. LT",LLLL:"dddd, D. MMMM YYYY kl. LT"},calendar:{sameDay:"[í dag kl.] LT",nextDay:"[á morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[í gær kl.] LT",lastWeek:"[síðasta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s:b,m:b,mm:b,h:"klukkustund",hh:b,d:b,dd:b,M:b,MM:b,y:b,yy:b},ordinal:function(a){return"."}};typeof module!="undefined"&&module.exports&&(module.exports=c),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("is",c)})();

View File

@ -0,0 +1,4 @@
// moment.js language configuration
// language : italian (it)
// author : Lorenzo : https://github.com/aliem
(function(){var a={months:"Gennaio_Febbraio_Marzo_Aprile_Maggio_Giugno_Luglio_Agosto_Settebre_Ottobre_Novembre_Dicembre".split("_"),monthsShort:"Gen_Feb_Mar_Apr_Mag_Giu_Lug_Ago_Set_Ott_Nov_Dic".split("_"),weekdays:"Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato".split("_"),weekdaysShort:"Dom_Lun_Mar_Mer_Gio_Ven_Sab".split("_"),weekdaysMin:"D_L_Ma_Me_G_V_S".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:"[lo scorso] dddd [alle] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s fa",s:"secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinal:function(){return"º"}};typeof module!="undefined"&&module.exports&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("it",a)})();

View File

@ -0,0 +1,4 @@
// moment.js language configuration
// language : japanese (ja)
// author : LI Long : https://github.com/baryon
(function(){var a={months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"Ah時m分",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日LT",LLLL:"YYYY年M月D日LT dddd"},meridiem:function(a,b,c){return a<12?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:"[来週]dddd LT",lastDay:"[昨日] LT",lastWeek:"[前週]dddd LT",sameElse:"L"},relativeTime:{future:"%s後",past:"%s前",s:"数秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"},ordinal:function(a){return""}};typeof module!="undefined"&&module.exports&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("ja",a)})();

View File

@ -0,0 +1,6 @@
// moment.js language configuration
// language : japanese (jp)
// author : LI Long : https://github.com/baryon
// This language config was incorrectly named 'jp' instead of 'ja'.
// In version 2.0.0, this will be deprecated and you should use 'ja' instead.
(function(){var a={months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"Ah時m分",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日LT",LLLL:"YYYY年M月D日LT dddd"},meridiem:function(a,b,c){return a<12?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:"[来週]dddd LT",lastDay:"[昨日] LT",lastWeek:"[前週]dddd LT",sameElse:"L"},relativeTime:{future:"%s後",past:"%s前",s:"数秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"},ordinal:function(a){return""}};typeof module!="undefined"&&module.exports&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("jp",a)})();

View File

@ -0,0 +1,4 @@
// moment.js language configuration
// language : korean (ko)
// author : Kyungwook, Park : https://github.com/kyungw00k
(function(){var a={months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h시 mm분",L:"YYYY.MM.DD",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 LT",LLLL:"YYYY년 MMMM D일 dddd LT"},meridiem:function(a,b,c){return a<12?"오전":"오후"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇초",ss:"%d초",m:"일분",mm:"%d분",h:"한시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한달",MM:"%d달",y:"일년",yy:"%d년"},ordinal:function(a){return"일"}};typeof module!="undefined"&&module.exports&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("ko",a)})();

View File

@ -0,0 +1,6 @@
// moment.js language configuration
// language : korean (kr)
// author : Kyungwook, Park : https://github.com/kyungw00k
// This language config was incorrectly named 'kr' instead of 'ko'.
// In version 2.0.0, this will be deprecated and you should use 'ko' instead.
(function(){var a={months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h시 mm분",L:"YYYY.MM.DD",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 LT",LLLL:"YYYY년 MMMM D일 dddd LT"},meridiem:function(a,b,c){return a<12?"오전":"오후"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇초",ss:"%d초",m:"일분",mm:"%d분",h:"한시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한달",MM:"%d달",y:"일년",yy:"%d년"},ordinal:function(a){return"일"}};typeof module!="undefined"&&module.exports&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("kr",a)})();

View File

@ -0,0 +1,4 @@
// moment.js language configuration
// language : norwegian bokmål (nb)
// author : Espen Hovlandsdal : https://github.com/rexxars
(function(){var a={months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[I dag klokken] LT",nextDay:"[I morgen klokken] LT",nextWeek:"dddd [klokken] LT",lastDay:"[I går klokken] LT",lastWeek:"[Forrige] dddd [klokken] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"for %s siden",s:"noen sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"},ordinal:function(a){return"."}};typeof module!="undefined"&&module.exports&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("nb",a)})();

View File

@ -0,0 +1,4 @@
// moment.js language configuration
// language : dutch (nl)
// author : Joris Röling : https://github.com/jjupiter
(function(){var a="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),b="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),c={months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(c,d){return/-MMM-/.test(d)?b[c.month()]:a[c.month()]},weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"Zo_Ma_Di_Wo_Do_Vr_Za".split("_"),longDateFormat:{LT:"HH:mm",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[Vandaag om] LT",nextDay:"[Morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[Gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},ordinal:function(a){return a===1||a===8||a>=20?"ste":"de"}};typeof module!="undefined"&&module.exports&&(module.exports=c),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("nl",c)})();

View File

@ -0,0 +1,4 @@
// moment.js language configuration
// language : polish (pl)
// author : Rafal Hirsz : https://github.com/evoL
(function(){var a=function(a){return a%10<5&&a%10>1&&~~(a/10)!==1},b=function(b,c,d){var e=b+" ";switch(d){case"m":return c?"minuta":"minutę";case"mm":return e+(a(b)?"minuty":"minut");case"h":return c?"godzina":"godzinę";case"hh":return e+(a(b)?"godziny":"godzin");case"MM":return e+(a(b)?"miesiące":"miesięcy");case"yy":return e+(a(b)?"lata":"lat")}},c={months:"styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"nie_pon_wt_śr_czw_pt_sb".split("_"),weekdaysMin:"N_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:"[W] dddd [o] LT",lastDay:"[Wczoraj o] LT",lastWeek:"[W zeszły/łą] dddd [o] LT",sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",m:b,mm:b,h:b,hh:b,d:"1 dzień",dd:"%d dni",M:"miesiąc",MM:b,y:"rok",yy:b},ordinal:function(a){return"."}};typeof module!="undefined"&&module.exports&&(module.exports=c),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("pl",c)})();

View File

@ -0,0 +1,4 @@
// moment.js language configuration
// language : brazilian portuguese (pt-br)
// author : Caio Ribeiro Pereira : https://github.com/caio-ribeiro-pereira
(function(){var a={months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Dom_2ª_3ª_4ª_5ª_6ª_Sáb".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D \\de MMMM \\de YYYY",LLL:"D \\de MMMM \\de YYYY LT",LLLL:"dddd, D \\de MMMM \\de YYYY LT"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return this.day()===0||this.day()===6?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"%s atrás",s:"segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinal:function(a){return"º"}};typeof module!="undefined"&&module.exports&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("pt-br",a)})();

View File

@ -0,0 +1,4 @@
// moment.js language configuration
// language : portuguese (pt)
// author : Jefferson : https://github.com/jalex79
(function(){var a={months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Dom_2ª_3ª_4ª_5ª_6ª_Sáb".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D \\de MMMM \\de YYYY",LLL:"D \\de MMMM \\de YYYY LT",LLLL:"dddd, D \\de MMMM \\de YYYY LT"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return this.day()===0||this.day()===6?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"%s atrás",s:"segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinal:function(a){return"º"}};typeof module!="undefined"&&module.exports&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("pt",a)})();

View File

@ -0,0 +1,4 @@
// moment.js language configuration
// language : russian (ru)
// author : Viktorminator : https://github.com/Viktorminator
(function(){var a=[function(a){return a%10===1&&a%100!==11},function(a){return a%10>=2&&a%10<=4&&a%10%1===0&&(a%100<12||a%100>14)},function(a){return a%10===0||a%10>=5&&a%10<=9&&a%10%1===0||a%100>=11&&a%100<=14&&a%100%1===0},function(a){return!0}],b=function(b,c){var d=b.split("_"),e=Math.min(a.length,d.length),f=-1;while(++f<e)if(a[f](c))return d[f];return d[e-1]},c=function(a,c,d){var e={mm:"минута_минуты_минут_минуты",hh:асасаасов_часа",dd:ень_дня_дней_дня",MM:есяц_месяцаесяцев_месяца",yy:"год_годает_года"};return d==="m"?c?"минута":"минуту":a+" "+b(e[d],+a)},d=function(a,b){var c={nominative:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),accusative:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_")},d=/D[oD]? *MMMM?/.test(b)?"accusative":"nominative";return c[d][a.month()]},e=function(a,b){var c={nominative:оскресенье_понедельник_вторник_средаетверг_пятница_суббота".split("_"),accusative:оскресенье_понедельник_вторник_средуетверг_пятницу_субботу".split("_")},d=/\[ ?[Вв] ?(?:прошлую|следующую)? ?\] ?dddd/.test(b)?"accusative":"nominative";return c[d][a.day()]},f={months:d,monthsShort:"янв_фев_мар_апрай_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:e,weekdaysShort:ск_пнд_втр_срд_чтв_птн_сбт".split("_"),weekdaysMin:с_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., LT",LLLL:"dddd, D MMMM YYYY г., LT"},calendar:{sameDay:"[Сегодня в] LT",nextDay:"[Завтра в] LT",lastDay:"[Вчера в] LT",nextWeek:function(){return this.day()===2?"[Во] dddd [в] LT":"[В] dddd [в] LT"},lastWeek:function(){switch(this.day()){case 0:return"[В прошлое] dddd [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",m:c,mm:c,h:"час",hh:c,d:"день",dd:c,M:"месяц",MM:c,y:"год",yy:c},ordinal:function(a){return"."}};typeof module!="undefined"&&module.exports&&(module.exports=f),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("ru",f)})();

View File

@ -0,0 +1,4 @@
// moment.js language configuration
// language : swedish (sv)
// author : Jens Alm : https://github.com/ulmus
(function(){var a={months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),longDateFormat:{LT:"HH:mm",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[Idag klockan] LT",nextDay:"[Imorgon klockan] LT",lastDay:"[Igår klockan] LT",nextWeek:"dddd [klockan] LT",lastWeek:"[Förra] dddd[en klockan] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sen",s:"några sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},ordinal:function(a){var b=a%10;return~~(a%100/10)===1?"e":b===1?"a":b===2?"a":b===3?"e":"e"}};typeof module!="undefined"&&module.exports&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("sv",a)})();

View File

@ -0,0 +1,5 @@
// moment.js language configuration
// language : turkish (tr)
// authors : Erhan Gundogan : https://github.com/erhangundogan,
// Burak Yiğit Kaya: https://github.com/BYK
(function(){var a={1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"},b={months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),longDateFormat:{LT:"HH:mm",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[haftaya] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen hafta] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(b){if(b===0)return"'ıncı";var c=b%10,d=b%100-c,e=b>=100?100:null;return a[c]||a[d]||a[e]}};typeof module!="undefined"&&module.exports&&(module.exports=b),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("tr",b)})();

View File

@ -0,0 +1,4 @@
// moment.js language configuration
// language : chinese
// author : suupic : https://github.com/suupic
(function(){var a={months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"Ah点mm",L:"YYYY年MMMD日",LL:"YYYY年MMMD日",LLL:"YYYY年MMMD日LT",LLLL:"YYYY年MMMD日ddddLT"},meridiem:function(a,b,c){return a<9?"早上":a<11&&b<30?"上午":a<13&&b<30?"中午":a<18?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1分钟",mm:"%d分钟",h:"1小时",hh:"%d小时",d:"1天",dd:"%d天",M:"1个月",MM:"%d个月",y:"1年",yy:"%d年"},ordinal:function(a){return""}};typeof module!="undefined"&&module.exports&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("zh-cn",a)})();

View File

@ -0,0 +1,4 @@
// moment.js language configuration
// language : traditional chinese (zh-tw)
// author : Ben : https://github.com/ben-lin
(function(){var a={months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"Ah點mm",L:"YYYY年MMMD日",LL:"YYYY年MMMD日",LLL:"YYYY年MMMD日LT",LLLL:"YYYY年MMMD日ddddLT"},meridiem:function(a,b,c){return a<9?"早上":a<11&&b<30?"上午":a<13&&b<30?"中午":a<18?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",m:"一分鐘",mm:"%d分鐘",h:"一小時",hh:"%d小時",d:"一天",dd:"%d天",M:"一個月",MM:"%d個月",y:"一年",yy:"%d年"},ordinal:function(a){return""}};typeof module!="undefined"&&module.exports&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("zh-tw",a)})();

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,440 @@
// moment.js
// version : 1.7.0
// author : Tim Wood
// license : MIT
// momentjs.com
(function(a, b) {
function G(a, b, c) {
this._d = a, this._isUTC = !!b, this._a = a._a || null, a._a = null, this._lang = c || !1;
}
function H(a) {
var b = this._data = {}, c = a.years || a.y || 0, d = a.months || a.M || 0, e = a.weeks || a.w || 0, f = a.days || a.d || 0, g = a.hours || a.h || 0, h = a.minutes || a.m || 0, i = a.seconds || a.s || 0, j = a.milliseconds || a.ms || 0;
this._milliseconds = j + i * 1e3 + h * 6e4 + g * 36e5, this._days = f + e * 7, this._months = d + c * 12, b.milliseconds = j % 1e3, i += I(j / 1e3), b.seconds = i % 60, h += I(i / 60), b.minutes = h % 60, g += I(h / 60), b.hours = g % 24, f += I(g / 24), f += e * 7, b.days = f % 30, d += I(f / 30), b.months = d % 12, c += I(d / 12), b.years = c, this._lang = !1;
}
function I(a) {
return a < 0 ? Math.ceil(a) : Math.floor(a);
}
function J(a, b) {
var c = a + "";
while (c.length < b) c = "0" + c;
return c;
}
function K(a, b, c) {
var d = b._milliseconds, e = b._days, f = b._months, g;
d && a._d.setTime(+a + d * c), e && a.date(a.date() + e * c), f && (g = a.date(), a.date(1).month(a.month() + f * c).date(Math.min(g, a.daysInMonth())));
}
function L(a) {
return Object.prototype.toString.call(a) === "[object Array]";
}
function M(a, b) {
var c = Math.min(a.length, b.length), d = Math.abs(a.length - b.length), e = 0, f;
for (f = 0; f < c; f++) ~~a[f] !== ~~b[f] && e++;
return e + d;
}
function N(b, c) {
var d, e;
for (d = 1; d < 7; d++) b[d] = b[d] == null ? d === 2 ? 1 : 0 : b[d];
return b[7] = c, e = new a(0), c ? (e.setUTCFullYear(b[0], b[1], b[2]), e.setUTCHours(b[3], b[4], b[5], b[6])) : (e.setFullYear(b[0], b[1], b[2]), e.setHours(b[3], b[4], b[5], b[6])), e._a = b, e;
}
function O(a, b) {
var d, e, f = [];
!b && i && (b = require("./lang/" + a));
for (d = 0; d < j.length; d++) b[j[d]] = b[j[d]] || g.en[j[d]];
for (d = 0; d < 12; d++) e = c([ 2e3, d ]), f[d] = new RegExp("^" + (b.months[d] || b.months(e, "")) + "|^" + (b.monthsShort[d] || b.monthsShort(e, "")).replace(".", ""), "i");
return b.monthsParse = b.monthsParse || f, g[a] = b, b;
}
function P(a) {
var b = typeof a == "string" && a || a && a._lang || null;
return b ? g[b] || O(b) : c;
}
function Q(a) {
return D[a] ? "'+(" + D[a] + ")+'" : a.replace(n, "").replace(/\\?'/g, "\\'");
}
function R(a) {
return P().longDateFormat[a] || a;
}
function S(a) {
var b = "var a,b;return '" + a.replace(l, Q) + "';", c = Function;
return new c("t", "v", "o", "p", "m", b);
}
function T(a) {
return C[a] || (C[a] = S(a)), C[a];
}
function U(a, b) {
function d(d, e) {
return c[d].call ? c[d](a, b) : c[d][e];
}
var c = P(a);
while (m.test(b)) b = b.replace(m, R);
return C[b] || (C[b] = S(b)), C[b](a, d, c.ordinal, J, c.meridiem);
}
function V(a) {
switch (a) {
case "DDDD":
return r;
case "YYYY":
return s;
case "S":
case "SS":
case "SSS":
case "DDD":
return q;
case "MMM":
case "MMMM":
case "dd":
case "ddd":
case "dddd":
case "a":
case "A":
return t;
case "Z":
case "ZZ":
return u;
case "T":
return v;
case "MM":
case "DD":
case "YY":
case "HH":
case "hh":
case "mm":
case "ss":
case "M":
case "D":
case "d":
case "H":
case "h":
case "m":
case "s":
return p;
default:
return new RegExp(a.replace("\\", ""));
}
}
function W(a, b, c, d) {
var e;
switch (a) {
case "M":
case "MM":
c[1] = b == null ? 0 : ~~b - 1;
break;
case "MMM":
case "MMMM":
for (e = 0; e < 12; e++) if (P().monthsParse[e].test(b)) {
c[1] = e;
break;
}
break;
case "D":
case "DD":
case "DDD":
case "DDDD":
b != null && (c[2] = ~~b);
break;
case "YY":
b = ~~b, c[0] = b + (b > 70 ? 1900 : 2e3);
break;
case "YYYY":
c[0] = ~~Math.abs(b);
break;
case "a":
case "A":
d.isPm = (b + "").toLowerCase() === "pm";
break;
case "H":
case "HH":
case "h":
case "hh":
c[3] = ~~b;
break;
case "m":
case "mm":
c[4] = ~~b;
break;
case "s":
case "ss":
c[5] = ~~b;
break;
case "S":
case "SS":
case "SSS":
c[6] = ~~(("0." + b) * 1e3);
break;
case "Z":
case "ZZ":
d.isUTC = !0, e = (b + "").match(z), e && e[1] && (d.tzh = ~~e[1]), e && e[2] && (d.tzm = ~~e[2]), e && e[0] === "+" && (d.tzh = -d.tzh, d.tzm = -d.tzm);
}
}
function X(a, b) {
var c = [ 0, 0, 1, 0, 0, 0, 0 ], d = {
tzh: 0,
tzm: 0
}, e = b.match(l), f, g;
for (f = 0; f < e.length; f++) g = (V(e[f]).exec(a) || [])[0], a = a.replace(V(e[f]), ""), W(e[f], g, c, d);
return d.isPm && c[3] < 12 && (c[3] += 12), d.isPm === !1 && c[3] === 12 && (c[3] = 0), c[3] += d.tzh, c[4] += d.tzm, N(c, d.isUTC);
}
function Y(a, b) {
var c, d = a.match(o) || [], e, f = 99, g, h, i;
for (g = 0; g < b.length; g++) h = X(a, b[g]), e = U(new G(h), b[g]).match(o) || [], i = M(d, e), i < f && (f = i, c = h);
return c;
}
function Z(b) {
var c = "YYYY-MM-DDT", d;
if (w.exec(b)) {
for (d = 0; d < 4; d++) if (y[d][1].exec(b)) {
c += y[d][0];
break;
}
return u.exec(b) ? X(b, c + " Z") : X(b, c);
}
return new a(b);
}
function $(a, b, c, d, e) {
var f = e.relativeTime[a];
return typeof f == "function" ? f(b || 1, !!c, a, d) : f.replace(/%d/i, b || 1);
}
function _(a, b, c) {
var d = e(Math.abs(a) / 1e3), f = e(d / 60), g = e(f / 60), h = e(g / 24), i = e(h / 365), j = d < 45 && [ "s", d ] || f === 1 && [ "m" ] || f < 45 && [ "mm", f ] || g === 1 && [ "h" ] || g < 22 && [ "hh", g ] || h === 1 && [ "d" ] || h <= 25 && [ "dd", h ] || h <= 45 && [ "M" ] || h < 345 && [ "MM", e(h / 30) ] || i === 1 && [ "y" ] || [ "yy", i ];
return j[2] = b, j[3] = a > 0, j[4] = c, $.apply({}, j);
}
function ab(a, b) {
c.fn[a] = function(a) {
var c = this._isUTC ? "UTC" : "";
return a != null ? (this._d["set" + c + b](a), this) : this._d["get" + c + b]();
};
}
function bb(a) {
c.duration.fn[a] = function() {
return this._data[a];
};
}
function cb(a, b) {
c.duration.fn["as" + a] = function() {
return +this / b;
};
}
var c, d = "1.7.0", e = Math.round, f, g = {}, h = "en", i = typeof module != "undefined" && module.exports, j = "months|monthsShort|weekdays|weekdaysShort|weekdaysMin|longDateFormat|calendar|relativeTime|ordinal|meridiem".split("|"), k = /^\/?Date\((\-?\d+)/i, l = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|SS?S?|zz?|ZZ?)/g, m = /(LT|LL?L?L?)/g, n = /(^\[)|(\\)|\]$/g, o = /([0-9a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)/gi, p = /\d\d?/, q = /\d{1,3}/, r = /\d{3}/, s = /\d{1,4}/, t = /[0-9a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+/i, u = /Z|[\+\-]\d\d:?\d\d/i, v = /T/i, w = /^\s*\d{4}-\d\d-\d\d(T(\d\d(:\d\d(:\d\d(\.\d\d?\d?)?)?)?)?([\+\-]\d\d:?\d\d)?)?/, x = "YYYY-MM-DDTHH:mm:ssZ", y = [ [ "HH:mm:ss.S", /T\d\d:\d\d:\d\d\.\d{1,3}/ ], [ "HH:mm:ss", /T\d\d:\d\d:\d\d/ ], [ "HH:mm", /T\d\d:\d\d/ ], [ "HH", /T\d\d/ ] ], z = /([\+\-]|\d\d)/gi, A = "Month|Date|Hours|Minutes|Seconds|Milliseconds".split("|"), B = {
Milliseconds: 1,
Seconds: 1e3,
Minutes: 6e4,
Hours: 36e5,
Days: 864e5,
Months: 2592e6,
Years: 31536e6
}, C = {}, D = {
M: "(a=t.month()+1)",
MMM: 'v("monthsShort",t.month())',
MMMM: 'v("months",t.month())',
D: "(a=t.date())",
DDD: "(a=new Date(t.year(),t.month(),t.date()),b=new Date(t.year(),0,1),a=~~(((a-b)/864e5)+1.5))",
d: "(a=t.day())",
dd: 'v("weekdaysMin",t.day())',
ddd: 'v("weekdaysShort",t.day())',
dddd: 'v("weekdays",t.day())',
w: "(a=new Date(t.year(),t.month(),t.date()-t.day()+5),b=new Date(a.getFullYear(),0,4),a=~~((a-b)/864e5/7+1.5))",
YY: "p(t.year()%100,2)",
YYYY: "p(t.year(),4)",
a: "m(t.hours(),t.minutes(),!0)",
A: "m(t.hours(),t.minutes(),!1)",
H: "t.hours()",
h: "t.hours()%12||12",
m: "t.minutes()",
s: "t.seconds()",
S: "~~(t.milliseconds()/100)",
SS: "p(~~(t.milliseconds()/10),2)",
SSS: "p(t.milliseconds(),3)",
Z: '((a=-t.zone())<0?((a=-a),"-"):"+")+p(~~(a/60),2)+":"+p(~~a%60,2)',
ZZ: '((a=-t.zone())<0?((a=-a),"-"):"+")+p(~~(10*a/6),4)'
}, E = "DDD w M D d".split(" "), F = "M D H h m s w".split(" ");
while (E.length) f = E.pop(), D[f + "o"] = D[f] + "+o(a)";
while (F.length) f = F.pop(), D[f + f] = "p(" + D[f] + ",2)";
D.DDDD = "p(" + D.DDD + ",3)", c = function(d, e) {
if (d === null || d === "") return null;
var f, g;
return c.isMoment(d) ? new G(new a(+d._d), d._isUTC, d._lang) : (e ? L(e) ? f = Y(d, e) : f = X(d, e) : (g = k.exec(d), f = d === b ? new a : g ? new a(+g[1]) : d instanceof a ? d : L(d) ? N(d) : typeof d == "string" ? Z(d) : new a(d)), new G(f));
}, c.utc = function(a, b) {
return L(a) ? new G(N(a, !0), !0) : (typeof a == "string" && !u.exec(a) && (a += " +0000", b && (b += " Z")), c(a, b).utc());
}, c.unix = function(a) {
return c(a * 1e3);
}, c.duration = function(a, b) {
var d = c.isDuration(a), e = typeof a == "number", f = d ? a._data : e ? {} : a, g;
return e && (b ? f[b] = a : f.milliseconds = a), g = new H(f), d && (g._lang = a._lang), g;
}, c.humanizeDuration = function(a, b, d) {
return c.duration(a, b === !0 ? null : b).humanize(b === !0 ? !0 : d);
}, c.version = d, c.defaultFormat = x, c.lang = function(a, b) {
var d;
if (!a) return h;
(b || !g[a]) && O(a, b);
if (g[a]) {
for (d = 0; d < j.length; d++) c[j[d]] = g[a][j[d]];
c.monthsParse = g[a].monthsParse, h = a;
}
}, c.langData = P, c.isMoment = function(a) {
return a instanceof G;
}, c.isDuration = function(a) {
return a instanceof H;
}, c.lang("en", {
months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
monthsShort: "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),
weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
weekdaysShort: "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),
weekdaysMin: "Su_Mo_Tu_We_Th_Fr_Sa".split("_"),
longDateFormat: {
LT: "h:mm A",
L: "MM/DD/YYYY",
LL: "MMMM D YYYY",
LLL: "MMMM D YYYY LT",
LLLL: "dddd, MMMM D YYYY LT"
},
meridiem: function(a, b, c) {
return a > 11 ? c ? "pm" : "PM" : c ? "am" : "AM";
},
calendar: {
sameDay: "[Today at] LT",
nextDay: "[Tomorrow at] LT",
nextWeek: "dddd [at] LT",
lastDay: "[Yesterday at] LT",
lastWeek: "[last] dddd [at] LT",
sameElse: "L"
},
relativeTime: {
future: "in %s",
past: "%s ago",
s: "a few seconds",
m: "a minute",
mm: "%d minutes",
h: "an hour",
hh: "%d hours",
d: "a day",
dd: "%d days",
M: "a month",
MM: "%d months",
y: "a year",
yy: "%d years"
},
ordinal: function(a) {
var b = a % 10;
return ~~(a % 100 / 10) === 1 ? "th" : b === 1 ? "st" : b === 2 ? "nd" : b === 3 ? "rd" : "th";
}
}), c.fn = G.prototype = {
clone: function() {
return c(this);
},
valueOf: function() {
return +this._d;
},
unix: function() {
return Math.floor(+this._d / 1e3);
},
toString: function() {
return this._d.toString();
},
toDate: function() {
return this._d;
},
toArray: function() {
var a = this;
return [ a.year(), a.month(), a.date(), a.hours(), a.minutes(), a.seconds(), a.milliseconds(), !!this._isUTC ];
},
isValid: function() {
return this._a ? !M(this._a, (this._a[7] ? c.utc(this) : this).toArray()) : !isNaN(this._d.getTime());
},
utc: function() {
return this._isUTC = !0, this;
},
local: function() {
return this._isUTC = !1, this;
},
format: function(a) {
return U(this, a ? a : c.defaultFormat);
},
add: function(a, b) {
var d = b ? c.duration(+b, a) : c.duration(a);
return K(this, d, 1), this;
},
subtract: function(a, b) {
var d = b ? c.duration(+b, a) : c.duration(a);
return K(this, d, -1), this;
},
diff: function(a, b, d) {
var f = this._isUTC ? c(a).utc() : c(a).local(), g = (this.zone() - f.zone()) * 6e4, h = this._d - f._d - g, i = this.year() - f.year(), j = this.month() - f.month(), k = this.date() - f.date(), l;
return b === "months" ? l = i * 12 + j + k / 30 : b === "years" ? l = i + (j + k / 30) / 12 : l = b === "seconds" ? h / 1e3 : b === "minutes" ? h / 6e4 : b === "hours" ? h / 36e5 : b === "days" ? h / 864e5 : b === "weeks" ? h / 6048e5 : h, d ? l : e(l);
},
from: function(a, b) {
return c.duration(this.diff(a)).lang(this._lang).humanize(!b);
},
fromNow: function(a) {
return this.from(c(), a);
},
calendar: function() {
var a = this.diff(c().sod(), "days", !0), b = this.lang().calendar, d = b.sameElse, e = a < -6 ? d : a < -1 ? b.lastWeek : a < 0 ? b.lastDay : a < 1 ? b.sameDay : a < 2 ? b.nextDay : a < 7 ? b.nextWeek : d;
return this.format(typeof e == "function" ? e.apply(this) : e);
},
isLeapYear: function() {
var a = this.year();
return a % 4 === 0 && a % 100 !== 0 || a % 400 === 0;
},
isDST: function() {
return this.zone() < c([ this.year() ]).zone() || this.zone() < c([ this.year(), 5 ]).zone();
},
day: function(a) {
var b = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
return a == null ? b : this.add({
d: a - b
});
},
startOf: function(a) {
switch (a.replace(/s$/, "")) {
case "year":
this.month(0);
case "month":
this.date(1);
case "day":
this.hours(0);
case "hour":
this.minutes(0);
case "minute":
this.seconds(0);
case "second":
this.milliseconds(0);
}
return this;
},
endOf: function(a) {
return this.startOf(a).add(a.replace(/s?$/, "s"), 1).subtract("ms", 1);
},
sod: function() {
return this.clone().startOf("day");
},
eod: function() {
return this.clone().endOf("day");
},
zone: function() {
return this._isUTC ? 0 : this._d.getTimezoneOffset();
},
daysInMonth: function() {
return c.utc([ this.year(), this.month() + 1, 0 ]).date();
},
lang: function(a) {
return a === b ? P(this) : (this._lang = a, this);
}
};
for (f = 0; f < A.length; f++) ab(A[f].toLowerCase(), A[f]);
ab("year", "FullYear"), c.duration.fn = H.prototype = {
weeks: function() {
return I(this.days() / 7);
},
valueOf: function() {
return this._milliseconds + this._days * 864e5 + this._months * 2592e6;
},
humanize: function(a) {
var b = +this, c = this.lang().relativeTime, d = _(b, !a, this.lang());
return a && (d = (b <= 0 ? c.past : c.future).replace(/%s/i, d)), d;
},
lang: c.fn.lang
};
for (f in B) B.hasOwnProperty(f) && (cb(f, B[f]), bb(f.toLowerCase()));
cb("Weeks", 6048e5), i && (module.exports = c), typeof ender == "undefined" && (this.moment = c), typeof define == "function" && define.amd && define("moment", [], function() {
return c;
});
}).call(this, Date);

1106
node_modules/emailjs/node_modules/moment/moment.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

61
node_modules/emailjs/node_modules/moment/package.json generated vendored Executable file

File diff suppressed because one or more lines are too long

228
node_modules/emailjs/node_modules/moment/readme.md generated vendored Executable file
View File

@ -0,0 +1,228 @@
[Moment.js](http://momentjs.com)
================================
A lightweight javascript date library for parsing, validating, manipulating, and formatting dates.
### [Check out the website](http://momentjs.com)
### [Read the documentation](http://momentjs.com/docs/)
### [Run the unit tests](http://momentjs.com/test/)
Upgrading to 1.6.0
==================
There are a few things being deprecated in the 1.6.0 release.
1. The format tokens `z` and `zz` (timezone abbreviations like EST CST MST etc) will no longer be supported. Due to inconsistent browser support, we are unable to consistently produce this value. See [this issue](https://github.com/timrwood/moment/issues/162) for more background.
2. The method `moment.fn.native` is deprecated in favor of `moment.fn.toDate`. There continue to be issues with Google Closure Compiler throwing errors when using `native`, even in valid instances.
3. The way to customize am/pm strings is being changed. This would only affect you if you created a custom language file. For more information, see [this issue](https://github.com/timrwood/moment/pull/222).
Contributing
============
To contribute, fork the library and install these npm packages.
npm install jshint uglify-js nodeunit
You can add tests to the files in `/test/moment` or add a new test file if you are adding a new feature.
To run the tests, do `make test` to run all tests, `make test-moment` to test the core library, and `make test-lang` to test all the languages.
To check the filesize, you can use `make size`.
To minify all the files, use `make moment` to minify moment, `make langs` to minify all the lang files, or just `make` to minfy everything.
If your code passes the unit tests (including the ones you wrote), submit a pull request.
Submitting pull requests
========================
Moment.js now uses [git-flow](https://github.com/nvie/gitflow). If you're not familiar with git-flow, please read up on it, you'll be glad you did.
When submitting new features, please create a new feature branch using `git flow feature start <name>` and submit the pull request to the `develop` branch.
Pull requests for enhancements for features should be submitted to the `develop` branch as well.
When submitting a bugfix, please check if there is an existing bugfix branch. If the latest stable version is `1.5.0`, the bugfix branch would be `hotfix/1.5.1`. All pull requests for bug fixes should be on a `hotfix` branch, unless the bug fix depends on a new feature.
The `master` branch should always have the latest stable version. When bugfix or minor releases are needed, the develop/hotfix branch will be merged into master and released.
Changelog
=========
### 1.7.0 [See discussion](https://github.com/timrwood/moment/issues/288)
Added `moment.fn.endOf()` and `moment.fn.startOf()`.
Added validation via `moment.fn.isValid()`.
Made formatting method 3x faster. http://jsperf.com/momentjs-cached-format-functions
Add support for month/weekday callbacks in `moment.fn.format()`
Added instance specific languages.
Added two letter weekday abbreviations with the formatting token `dd`.
Various language updates.
Various bugfixes.
### 1.6.0 [See discussion](https://github.com/timrwood/moment/pull/268)
Added Durations.
Revamped parser to support parsing non-separated strings (YYYYMMDD vs YYYY-MM-DD).
Added support for millisecond parsing and formatting tokens (S SS SSS)
Added a getter for `moment.lang()`
Various bugfixes.
### 1.5.0 [See milestone](https://github.com/timrwood/moment/issues?milestone=10&page=1&state=closed)
Added UTC mode.
Added automatic ISO8601 parsing.
Various bugfixes.
### 1.4.0 [See milestone](https://github.com/timrwood/moment/issues?milestone=8&state=closed)
Added `moment.fn.toDate` as a replacement for `moment.fn.native`.
Added `moment.fn.sod` and `moment.fn.eod` to get the start and end of day.
Various bugfixes.
### 1.3.0 [See milestone](https://github.com/timrwood/moment/issues?milestone=7&state=closed)
Added support for parsing month names in the current language.
Added escape blocks for parsing tokens.
Added `moment.fn.calendar` to format strings like 'Today 2:30 PM', 'Tomorrow 1:25 AM', and 'Last Sunday 4:30 AM'.
Added `moment.fn.day` as a setter.
Various bugfixes
### 1.2.0 [See milestone](https://github.com/timrwood/moment/issues?milestone=4&state=closed)
Added timezones to parser and formatter.
Added `moment.fn.isDST`.
Added `moment.fn.zone` to get the timezone offset in minutes.
### 1.1.2 [See milestone](https://github.com/timrwood/moment/issues?milestone=6&state=closed)
Various bugfixes
### 1.1.1 [See milestone](https://github.com/timrwood/moment/issues?milestone=5&state=closed)
Added time specific diffs (months, days, hours, etc)
### 1.1.0
Added `moment.fn.format` localized masks. 'L LL LLL LLLL' [issue 29](https://github.com/timrwood/moment/pull/29)
Fixed [issue 31](https://github.com/timrwood/moment/pull/31).
### 1.0.1
Added `moment.version` to get the current version.
Removed `window !== undefined` when checking if module exists to support browserify. [issue 25](https://github.com/timrwood/moment/pull/25)
### 1.0.0
Added convenience methods for getting and setting date parts.
Added better support for `moment.add()`.
Added better lang support in NodeJS.
Renamed library from underscore.date to Moment.js
### 0.6.1
Added Portuguese, Italian, and French language support
### 0.6.0
Added _date.lang() support.
Added support for passing multiple formats to try to parse a date. _date("07-10-1986", ["MM-DD-YYYY", "YYYY-MM-DD"]);
Made parse from string and single format 25% faster.
### 0.5.2
Buxfix for [issue 8](https://github.com/timrwood/underscore.date/pull/8) and [issue 9](https://github.com/timrwood/underscore.date/pull/9).
### 0.5.1
Buxfix for [issue 5](https://github.com/timrwood/underscore.date/pull/5).
### 0.5.0
Dropped the redundant `_date.date()` in favor of `_date()`.
Removed `_date.now()`, as it is a duplicate of `_date()` with no parameters.
Removed `_date.isLeapYear(yearNuumber)`. Use `_date([yearNumber]).isLeapYear()` instead.
Exposed customization options through the `_date.relativeTime`, `_date.weekdays`, `_date.weekdaysShort`, `_date.months`, `_date.monthsShort`, and `_date.ordinal` variables instead of the `_date.customize()` function.
### 0.4.1
Added date input formats for input strings.
### 0.4.0
Added underscore.date to npm. Removed dependancies on underscore.
### 0.3.2
Added `'z'` and `'zz'` to `_.date().format()`. Cleaned up some redundant code to trim off some bytes.
### 0.3.1
Cleaned up the namespace. Moved all date manipulation and display functions to the _.date() object.
### 0.3.0
Switched to the Underscore methodology of not mucking with the native objects' prototypes.
Made chaining possible.
### 0.2.1
Changed date names to be a more pseudo standardized 'dddd, MMMM Do YYYY, h:mm:ss a'.
Added `Date.prototype` functions `add`, `subtract`, `isdst`, and `isleapyear`.
### 0.2.0
Changed function names to be more concise.
Changed date format from php date format to custom format.
### 0.1.0
Initial release
License
=======
Moment.js is freely distributable under the terms of the MIT license.
Copyright (c) 2011-2012 Tim Wood
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -0,0 +1,55 @@
var https = require("https"),
zlib = require('zlib'),
path = require('path'),
fs = require('fs');
var stable = '1.6.2';
function getVersion(path, cb) {
var data = '',
req = https.request({
host: 'raw.github.com',
port: 443,
path: '/timrwood/moment/' + path
}, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
data += chunk;
});
res.on('end', function(e) {
zlib.gzip(data, function(error, result) {
cb(data.length, result.length);
});
});
});
req.on('error', function(e) {
console.log('problem with request: ' + e.message);
});
req.end();
}
function printDiffs(stableLen, stableGzip, currentLen, currentGzip) {
var diff = currentLen - stableLen,
gzipDiff = currentGzip - stableGzip;
console.log("Filesize difference from current branch to " + stable);
console.log(stable + " " + stableLen + ' / ' + stableGzip);
console.log("curr " + currentLen + ' / ' + currentGzip);
console.log("diff " + (diff > 0 ? '+' : '') + diff);
console.log("gzip " + (gzipDiff > 0 ? '+' : '') + gzipDiff);
}
(function(){
fs.readFile(path.normalize(__dirname + '/../min/moment.min.js'), 'utf8', function(err, data){
if (err) {
throw err;
}
zlib.gzip(data, function(error, result) {
getVersion(stable + '/min/moment.min.js', function (stableLength, stableGzipLength) {
printDiffs(stableLength, stableGzipLength, data.length, result.length);
});
});
});
}());

View File

@ -0,0 +1,108 @@
var https = require("https"),
zlib = require('zlib'),
path = require('path'),
fs = require('fs');
var count = 0;
var resolved = 0;
var outputs = [];
function check() {
if (resolved === count) {
normalize();
display();
}
}
function makeBar(length) {
var i = '';
while (i.length < length) {
i += '=';
}
return i;
}
function normalize() {
var i,
max = 0,
max2 = 0;
for (i = 0; i < count; i ++) {
max = Math.max(max, outputs[i].gzip);
max2 = Math.max(max2, outputs[i].original);
}
for (i = 0; i < count; i ++) {
outputs[i].bargraph = makeBar((outputs[i].gzip / max) * 80);
outputs[i].bargraph2 = makeBar((outputs[i].original / max2) * 80);
}
}
function display() {
var i;
for (i = 0; i < count; i ++) {
console.log(outputs[i].version + ' ' + outputs[i].gzip + ' ' + outputs[i].original);
console.log('gzip ' + outputs[i].bargraph);
console.log('orig ' + outputs[i].bargraph2);
}
}
function getSizeAtVersion(version, path) {
var data = '';
var op = {};
var req = https.request({
host: 'raw.github.com',
port: 443,
path: '/timrwood/moment/' + version + path
}, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
data += chunk;
});
res.on('end', function(e) {
zlib.gzip(data, function(error, result) {
op.version = version;
op.gzip = result.length;
op.original = data.length;
resolved ++;
check();
});
});
});
req.on('error', function(e) {
console.log('problem with request: ' + e.message);
});
req.end();
count++;
outputs.push(op);
}
(function(){
var old_versions = '1.0.1 1.1.0 1.1.1 1.1.2 1.2.0 1.3.0 1.4.0'.split(' ');
var new_versions = '1.5.0 1.5.1 1.6.0 1.6.1'.split(' ');
var i;
for (i = 0; i < old_versions.length; i++) {
getSizeAtVersion(old_versions[i], '/moment.min.js');
}
for (i = 0; i < new_versions.length; i++) {
getSizeAtVersion(new_versions[i], '/min/moment.min.js');
}
}());
(function(){
count ++;
var op = {};
outputs.push(op);
fs.readFile(path.normalize(__dirname + '/../min/moment.min.js'), 'utf8', function(err, data){
if (err) throw err;
zlib.gzip(data, function(error, result) {
op.version = '.next';
op.gzip = result.length;
op.original = data.length;
resolved ++;
check();
});
});
}());

View File

@ -0,0 +1,265 @@
var moment = require("../../moment");
/**************************************************
Bulgarian
*************************************************/
exports["lang:bg"] = {
"parse" : function(test) {
test.expect(96);
moment.lang('bg');
var tests = 'януари янревруари фев_март мар_април апрай май_юни юни_юли юли_август авг_септември сеп_октомври окт_ноември ноеекември дек'.split("_");
var i;
function equalTest(input, mmm, i) {
test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
}
for (i = 0; i < 12; i++) {
tests[i] = tests[i].split(' ');
equalTest(tests[i][0], 'MMM', i);
equalTest(tests[i][1], 'MMM', i);
equalTest(tests[i][0], 'MMMM', i);
equalTest(tests[i][1], 'MMMM', i);
equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
}
test.done();
},
"format" : function(test) {
test.expect(18);
moment.lang('bg');
var a = [
['dddd, MMMM Do YYYY, h:mm:ss a', 'неделя, февруари 14. 2010, 3:25:50 pm'],
['ddd, hA', 'нед, 3PM'],
['M Mo MM MMMM MMM', '2 2. 02 февруари фев'],
['YYYY YY', '2010 10'],
['D Do DD', '14 14. 14'],
['d do dddd ddd dd', '0 0. неделя нед нд'],
['DDD DDDo DDDD', '45 45. 045'],
['w wo ww', '8 8. 08'],
['h hh', '3 03'],
['H HH', '15 15'],
['m mm', '25 25'],
['s ss', '50 50'],
['a A', 'pm PM'],
['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45. day of the year'],
['L', '14.02.2010'],
['LL', '14 февруари 2010'],
['LLL', '14 февруари 2010 3:25'],
['LLLL', 'неделя, 14 февруари 2010 3:25']
],
b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
i;
for (i = 0; i < a.length; i++) {
test.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
}
test.done();
},
"format ordinal" : function(test) {
test.expect(31);
moment.lang('bg');
test.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
test.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
test.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
test.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');
test.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');
test.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');
test.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');
test.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');
test.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');
test.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');
test.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');
test.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');
test.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');
test.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');
test.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');
test.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');
test.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');
test.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');
test.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');
test.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');
test.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');
test.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');
test.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');
test.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');
test.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');
test.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');
test.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');
test.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');
test.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');
test.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');
test.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');
test.done();
},
"format month" : function(test) {
test.expect(12);
moment.lang('bg');
var expected = 'януари янревруари фев_март мар_април апрай май_юни юни_юли юли_август авг_септември сеп_октомври окт_ноември ноеекември дек'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);
}
test.done();
},
"format week" : function(test) {
test.expect(7);
moment.lang('bg');
var expected = 'неделя нед нд_понеделник пон пн_вторник вто вт_сряда сря сретвъртък чет чт_петък пет пт_събота съб сб'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);
}
test.done();
},
"from" : function(test) {
test.expect(30);
moment.lang('bg');
var start = moment([2007, 1, 28]);
test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "няколко секунди", "44 seconds = a few seconds");
test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "минута", "45 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "минута", "89 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 минути", "90 seconds = 2 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 минути", "44 minutes = 44 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "час", "45 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "час", "89 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 часа", "90 minutes = 2 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 часа", "5 hours = 5 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 часа", "21 hours = 21 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "ден", "22 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "ден", "35 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 дни", "36 hours = 2 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "ден", "1 day = a day");
test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 дни", "5 days = 5 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 дни", "25 days = 25 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "месец", "26 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "месец", "30 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "месец", "45 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 месеца", "46 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 месеца", "75 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 месеца", "76 days = 3 months");
test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "месец", "1 month = a month");
test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 месеца", "5 months = 5 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 месеца", "344 days = 11 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "година", "345 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "година", "547 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 години", "548 days = 2 years");
test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "година", "1 year = a year");
test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 години", "5 years = 5 years");
test.done();
},
"suffix" : function(test) {
test.expect(2);
moment.lang('bg');
test.equal(moment(30000).from(0), "след няколко секунди", "prefix");
test.equal(moment(0).from(30000), "преди няколко секунди", "suffix");
test.done();
},
"now from now" : function(test) {
test.expect(1);
moment.lang('bg');
test.equal(moment().fromNow(), "преди няколко секунди", "now from now should display as in the past");
test.done();
},
"fromNow" : function(test) {
test.expect(2);
moment.lang('bg');
test.equal(moment().add({s:30}).fromNow(), "след няколко секунди", "in a few seconds");
test.equal(moment().add({d:5}).fromNow(), "след 5 дни", "in 5 days");
test.done();
},
"calendar day" : function(test) {
test.expect(6);
moment.lang('bg');
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Днес в 2:00", "today at the same time");
test.equal(moment(a).add({ m: 25 }).calendar(), "Днес в 2:25", "Now plus 25 min");
test.equal(moment(a).add({ h: 1 }).calendar(), "Днес в 3:00", "Now plus 1 hour");
test.equal(moment(a).add({ d: 1 }).calendar(), "Утре в 2:00", "tomorrow at the same time");
test.equal(moment(a).subtract({ h: 1 }).calendar(), "Днес в 1:00", "Now minus 1 hour");
test.equal(moment(a).subtract({ d: 1 }).calendar(), "Вчера в 2:00", "yesterday at the same time");
test.done();
},
"calendar next week" : function(test) {
test.expect(15);
moment.lang('bg');
var i;
var m;
for (i = 2; i < 7; i++) {
m = moment().add({ d: i });
test.equal(m.calendar(), m.format('dddd [в] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [в] LT'), "Today + " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('dddd [в] LT'), "Today + " + i + " days end of day");
}
test.done();
},
"calendar last week" : function(test) {
test.expect(15);
moment.lang('bg');
var i;
var m;
function makeFormat(d) {
switch (d.day()) {
case 0:
case 3:
case 6:
return '[В изминалата] dddd [в] LT';
case 1:
case 2:
case 4:
case 5:
return '[В изминалия] dddd [в] LT';
}
}
for (i = 2; i < 7; i++) {
m = moment().subtract({ d: i });
test.equal(m.calendar(), m.format(makeFormat(m)), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format(makeFormat(m)), "Today - " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format(makeFormat(m)), "Today - " + i + " days end of day");
}
test.done();
},
"calendar all else" : function(test) {
test.expect(4);
moment.lang('bg');
var weeksAgo = moment().subtract({ w: 1 });
var weeksFromNow = moment().add({ w: 1 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
weeksAgo = moment().subtract({ w: 2 });
weeksFromNow = moment().add({ w: 2 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
test.done();
}
};

View File

@ -0,0 +1,221 @@
var moment = require("../../moment");
/**************************************************
Català
*************************************************/
exports["lang:ca"] = {
"parse" : function(test) {
test.expect(96);
moment.lang('ca');
var tests = "Gener Gen._Febrer Febr._Març Mar._Abril Abr._Maig Mai._Juny Jun._Juliol Jul._Agost Ag._Setembre Set._Octubre Oct._Novembre Nov._Desembre Des.".split("_");
var i;
function equalTest(input, mmm, i) {
test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
}
for (i = 0; i < 12; i++) {
tests[i] = tests[i].split(' ');
equalTest(tests[i][0], 'MMM', i);
equalTest(tests[i][1], 'MMM', i);
equalTest(tests[i][0], 'MMMM', i);
equalTest(tests[i][1], 'MMMM', i);
equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
}
test.done();
},
"format ordinal" : function(test) {
test.expect(31);
moment.lang('ca');
test.equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
test.equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º');
test.equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º');
test.equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º');
test.equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º');
test.equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º');
test.equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º');
test.equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º');
test.equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º');
test.equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º');
test.equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º');
test.equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º');
test.equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º');
test.equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º');
test.equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º');
test.equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º');
test.equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º');
test.equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º');
test.equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º');
test.equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º');
test.equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º');
test.equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º');
test.equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º');
test.equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º');
test.equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º');
test.equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º');
test.equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º');
test.equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º');
test.equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º');
test.equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º');
test.equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º');
test.done();
},
"format month" : function(test) {
test.expect(12);
moment.lang('ca');
var expected = "Gener Gen._Febrer Febr._Març Mar._Abril Abr._Maig Mai._Juny Jun._Juliol Jul._Agost Ag._Setembre Set._Octubre Oct._Novembre Nov._Desembre Des.".split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);
}
test.done();
},
"format week" : function(test) {
test.expect(7);
moment.lang('ca');
var expected = "Diumenge Dg. Dg_Dilluns Dl. Dl_Dimarts Dt. Dt_Dimecres Dc. Dc_Dijous Dj. Dj_Divendres Dv. Dv_Dissabte Ds. Ds".split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);
}
test.done();
},
"from" : function(test) {
test.expect(30);
moment.lang('ca');
var start = moment([2007, 1, 28]);
test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "uns segons", "44 seconds = a few seconds");
test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "un minut", "45 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "un minut", "89 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minuts", "90 seconds = 2 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minuts", "44 minutes = 44 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "una hora", "45 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "una hora", "89 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 hores", "90 minutes = 2 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 hores", "5 hours = 5 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 hores", "21 hours = 21 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "un dia", "22 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "un dia", "35 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dies", "36 hours = 2 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "un dia", "1 day = a day");
test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dies", "5 days = 5 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dies", "25 days = 25 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "un mes", "26 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "un mes", "30 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "un mes", "45 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 mesos", "46 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 mesos", "75 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 mesos", "76 days = 3 months");
test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "un mes", "1 month = a month");
test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 mesos", "5 months = 5 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 mesos", "344 days = 11 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "un any", "345 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "un any", "547 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 anys", "548 days = 2 years");
test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "un any", "1 year = a year");
test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 anys", "5 years = 5 years");
test.done();
},
"suffix" : function(test) {
test.expect(2);
moment.lang('ca');
test.equal(moment(30000).from(0), "en uns segons", "prefix");
test.equal(moment(0).from(30000), "fa uns segons", "suffix");
test.done();
},
"now from now" : function(test) {
test.expect(1);
moment.lang('ca');
test.equal(moment().fromNow(), "fa uns segons", "now from now should display as in the past");
test.done();
},
"fromNow" : function(test) {
test.expect(2);
moment.lang('ca');
test.equal(moment().add({s:30}).fromNow(), "en uns segons", "en uns segons");
test.equal(moment().add({d:5}).fromNow(), "en 5 dies", "en 5 dies");
test.done();
},
"calendar day" : function(test) {
test.expect(7);
moment.lang('ca');
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "avui a les 2:00", "today at the same time");
test.equal(moment(a).add({ m: 25 }).calendar(), "avui a les 2:25", "Now plus 25 min");
test.equal(moment(a).add({ h: 1 }).calendar(), "avui a les 3:00", "Now plus 1 hour");
test.equal(moment(a).add({ d: 1 }).calendar(), "demà a les 2:00", "tomorrow at the same time");
test.equal(moment(a).add({ d: 1, h : -1 }).calendar(), "demà a la 1:00", "tomorrow minus 1 hour");
test.equal(moment(a).subtract({ h: 1 }).calendar(), "avui a la 1:00", "Now minus 1 hour");
test.equal(moment(a).subtract({ d: 1 }).calendar(), "ahir a les 2:00", "yesterday at the same time");
test.done();
},
"calendar next week" : function(test) {
test.expect(15);
moment.lang('ca');
var i;
var m;
for (i = 2; i < 7; i++) {
m = moment().add({ d: i });
test.equal(m.calendar(), m.format('dddd [a ' + ((m.hours() !== 1) ? 'les' : 'la') + '] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [a ' + ((m.hours() !== 1) ? 'les' : 'la') + '] LT'), "Today + " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('dddd [a ' + ((m.hours() !== 1) ? 'les' : 'la') + '] LT'), "Today + " + i + " days end of day");
}
test.done();
},
"calendar last week" : function(test) {
test.expect(15);
moment.lang('ca');
for (i = 2; i < 7; i++) {
m = moment().subtract({ d: i });
test.equal(m.calendar(), m.format('[el] dddd [passat a ' + ((m.hours() !== 1) ? 'les' : 'la') + '] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[el] dddd [passat a ' + ((m.hours() !== 1) ? 'les' : 'la') + '] LT'), "Today - " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('[el] dddd [passat a ' + ((m.hours() !== 1) ? 'les' : 'la') + '] LT'), "Today - " + i + " days end of day");
}
test.done();
},
"calendar all else" : function(test) {
test.expect(4);
moment.lang('ca');
var weeksAgo = moment().subtract({ w: 1 });
var weeksFromNow = moment().add({ w: 1 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
weeksAgo = moment().subtract({ w: 2 });
weeksFromNow = moment().add({ w: 2 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
test.done();
}
};

View File

@ -0,0 +1,246 @@
var moment = require("../../moment");
/**************************************************
Chuvash
*************************************************/
exports["lang:cv"] = {
"parse" : function(test) {
test.expect(96);
moment.lang('cv');
var tests = 'кăрлач кăрарăс нар_пуш пуш_ака акаай май_çĕртме çĕр_утă утă_çурла çур_авăн ав_юпа юпа_чӳк чӳк_раштав раш'.split("_");
var i;
function equalTest(input, mmm, i) {
test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
}
for (i = 0; i < 12; i++) {
tests[i] = tests[i].split(' ');
equalTest(tests[i][0], 'MMM', i);
equalTest(tests[i][1], 'MMM', i);
equalTest(tests[i][0], 'MMMM', i);
equalTest(tests[i][1], 'MMMM', i);
equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
}
test.done();
},
"format" : function(test) {
test.expect(18);
moment.lang('cv');
var a = [
['dddd, MMMM Do YYYY, h:mm:ss a', 'вырсарникун, нарăс 14-мĕш 2010, 3:25:50 pm'],
['ddd, hA', 'выр, 3PM'],
['M Mo MM MMMM MMM', '2 2-мĕш 02 нарăс нар'],
['YYYY YY', '2010 10'],
['D Do DD', '14 14-мĕш 14'],
['d do dddd ddd dd', '0 0-мĕш вырсарникун выр вр'],
['DDD DDDo DDDD', '45 45-мĕш 045'],
['w wo ww', '8 8-мĕш 08'],
['h hh', '3 03'],
['H HH', '15 15'],
['m mm', '25 25'],
['s ss', '50 50'],
['a A', 'pm PM'],
['Çулăн DDDo кунĕ', 'Çулăн 45-мĕш кунĕ'],
['L', '14-02-2010'],
['LL', '2010 çулхи нарăс уйăхĕн 14-мĕшĕ'],
['LLL', '2010 çулхи нарăс уйăхĕн 14-мĕшĕ, 15:25'],
['LLLL', 'вырсарникун, 2010 çулхи нарăс уйăхĕн 14-мĕшĕ, 15:25']
],
b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
i;
for (i = 0; i < a.length; i++) {
test.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
}
test.done();
},
"format ordinal" : function(test) {
test.expect(31);
moment.lang('cv');
test.equal(moment([2011, 0, 1]).format('DDDo'), '1-мĕш', '1-мĕш');
test.equal(moment([2011, 0, 2]).format('DDDo'), '2-мĕш', '2-мĕш');
test.equal(moment([2011, 0, 3]).format('DDDo'), '3-мĕш', '3-мĕш');
test.equal(moment([2011, 0, 4]).format('DDDo'), '4-мĕш', '4-мĕш');
test.equal(moment([2011, 0, 5]).format('DDDo'), '5-мĕш', '5-мĕш');
test.equal(moment([2011, 0, 6]).format('DDDo'), '6-мĕш', '6-мĕш');
test.equal(moment([2011, 0, 7]).format('DDDo'), '7-мĕш', '7-мĕш');
test.equal(moment([2011, 0, 8]).format('DDDo'), '8-мĕш', '8-мĕш');
test.equal(moment([2011, 0, 9]).format('DDDo'), '9-мĕш', '9-мĕш');
test.equal(moment([2011, 0, 10]).format('DDDo'), '10-мĕш', '10-мĕш');
test.equal(moment([2011, 0, 11]).format('DDDo'), '11-мĕш', '11-мĕш');
test.equal(moment([2011, 0, 12]).format('DDDo'), '12-мĕш', '12-мĕш');
test.equal(moment([2011, 0, 13]).format('DDDo'), '13-мĕш', '13-мĕш');
test.equal(moment([2011, 0, 14]).format('DDDo'), '14-мĕш', '14-мĕш');
test.equal(moment([2011, 0, 15]).format('DDDo'), '15-мĕш', '15-мĕш');
test.equal(moment([2011, 0, 16]).format('DDDo'), '16-мĕш', '16-мĕш');
test.equal(moment([2011, 0, 17]).format('DDDo'), '17-мĕш', '17-мĕш');
test.equal(moment([2011, 0, 18]).format('DDDo'), '18-мĕш', '18-мĕш');
test.equal(moment([2011, 0, 19]).format('DDDo'), '19-мĕш', '19-мĕш');
test.equal(moment([2011, 0, 20]).format('DDDo'), '20-мĕш', '20-мĕш');
test.equal(moment([2011, 0, 21]).format('DDDo'), '21-мĕш', '21-мĕш');
test.equal(moment([2011, 0, 22]).format('DDDo'), '22-мĕш', '22-мĕш');
test.equal(moment([2011, 0, 23]).format('DDDo'), '23-мĕш', '23-мĕш');
test.equal(moment([2011, 0, 24]).format('DDDo'), '24-мĕш', '24-мĕш');
test.equal(moment([2011, 0, 25]).format('DDDo'), '25-мĕш', '25-мĕш');
test.equal(moment([2011, 0, 26]).format('DDDo'), '26-мĕш', '26-мĕш');
test.equal(moment([2011, 0, 27]).format('DDDo'), '27-мĕш', '27-мĕш');
test.equal(moment([2011, 0, 28]).format('DDDo'), '28-мĕш', '28-мĕш');
test.equal(moment([2011, 0, 29]).format('DDDo'), '29-мĕш', '29-мĕш');
test.equal(moment([2011, 0, 30]).format('DDDo'), '30-мĕш', '30-мĕш');
test.equal(moment([2011, 0, 31]).format('DDDo'), '31-мĕш', '31-мĕш');
test.done();
},
"format month" : function(test) {
test.expect(12);
moment.lang('cv');
var expected = 'кăрлач кăрарăс нар_пуш пуш_ака акаай май_çĕртме çĕр_утă утă_çурла çур_авăн ав_юпа юпа_чӳк чӳк_раштав раш'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);
}
test.done();
},
"format week" : function(test) {
test.expect(7);
moment.lang('cv');
var expected = 'вырсарникун выр врунтикун тун тн_ытларикун ытл ыт_юнкун юн юн_кĕçнерникун кĕç кç_эрнекун эрн эр_шăматкун шăм шм'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);
}
test.done();
},
"from" : function(test) {
test.expect(30);
moment.lang('cv');
var start = moment([2007, 1, 28]);
test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "пĕр-ик çеккунт", "44 sekunder = a few seconds");
test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "пĕр минут", "45 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "пĕр минут", "89 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 минут", "90 seconds = 2 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 минут", "44 minutes = 44 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "пĕр сехет", "45 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "пĕр сехет", "89 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 сехет", "90 minutes = 2 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 сехет", "5 hours = 5 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 сехет", "21 hours = 21 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "пĕр кун", "22 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "пĕр кун", "35 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 кун", "36 hours = 2 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "пĕр кун", "1 day = a day");
test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 кун", "5 days = 5 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 кун", "25 days = 25 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "пĕр уйăх", "26 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "пĕр уйăх", "30 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "пĕр уйăх", "45 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 уйăх", "46 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 уйăх", "75 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 уйăх", "76 days = 3 months");
test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "пĕр уйăх", "1 month = a month");
test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 уйăх", "5 months = 5 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 уйăх", "344 days = 11 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "пĕр çул", "345 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "пĕр çул", "547 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 çул", "548 days = 2 years");
test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "пĕр çул", "1 year = a year");
test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 çул", "5 years = 5 years");
test.done();
},
"suffix" : function(test) {
test.expect(2);
moment.lang('cv');
test.equal(moment(30000).from(0), "пĕр-ик çеккунтран", "prefix");
test.equal(moment(0).from(30000), "пĕр-ик çеккунт каялла", "suffix");
test.done();
},
"now from now" : function(test) {
test.expect(1);
moment.lang('cv');
test.equal(moment().fromNow(), "пĕр-ик çеккунт каялла", "now from now should display as in the past");
test.done();
},
"fromNow" : function(test) {
test.expect(2);
moment.lang('cv');
test.equal(moment().add({s:30}).fromNow(), "пĕр-ик çеккунтран", "in a few seconds");
test.equal(moment().add({d:5}).fromNow(), "5 кунран", "in 5 days");
test.done();
},
"calendar day" : function(test) {
test.expect(6);
moment.lang('cv');
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Паян 02:00 сехетре", "today at the same time");
test.equal(moment(a).add({ m: 25 }).calendar(), "Паян 02:25 сехетре", "Now plus 25 min");
test.equal(moment(a).add({ h: 1 }).calendar(), "Паян 03:00 сехетре", "Now plus 1 hour");
test.equal(moment(a).add({ d: 1 }).calendar(), "Ыран 02:00 сехетре", "tomorrow at the same time");
test.equal(moment(a).subtract({ h: 1 }).calendar(), "Паян 01:00 сехетре", "Now minus 1 hour");
test.equal(moment(a).subtract({ d: 1 }).calendar(), "Ĕнер 02:00 сехетре", "yesterday at the same time");
test.done();
},
"calendar next week" : function(test) {
test.expect(15);
moment.lang('cv');
var i;
var m;
for (i = 2; i < 7; i++) {
m = moment().add({ d: i });
test.equal(m.calendar(), m.format('[Çитес] dddd LT [сехетре]'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[Çитес] dddd LT [сехетре]'), "Today + " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('[Çитес] dddd LT [сехетре]'), "Today + " + i + " days end of day");
}
test.done();
},
"calendar last week" : function(test) {
test.expect(15);
moment.lang('cv');
for (i = 2; i < 7; i++) {
m = moment().subtract({ d: i });
test.equal(m.calendar(), m.format('[Иртнĕ] dddd LT [сехетре]'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[Иртнĕ] dddd LT [сехетре]'), "Today - " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('[Иртнĕ] dddd LT [сехетре]'), "Today - " + i + " days end of day");
}
test.done();
},
"calendar all else" : function(test) {
test.expect(4);
moment.lang('cv');
var weeksAgo = moment().subtract({ w: 1 });
var weeksFromNow = moment().add({ w: 1 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
weeksAgo = moment().subtract({ w: 2 });
weeksFromNow = moment().add({ w: 2 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
test.done();
}
};

View File

@ -0,0 +1,183 @@
var moment = require("../../moment");
/**************************************************
Danish
*************************************************/
exports["lang:da"] = {
"parse" : function(test) {
test.expect(96);
moment.lang('da');
var tests = 'Januar Jan_Februar Feb_Marts Mar_April Apr_Maj Maj_Juni Jun_Juli Jul_August Aug_September Sep_Oktober Okt_November Nov_December Dec'.split("_");
var i;
function equalTest(input, mmm, i) {
test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
}
for (i = 0; i < 12; i++) {
tests[i] = tests[i].split(' ');
equalTest(tests[i][0], 'MMM', i);
equalTest(tests[i][1], 'MMM', i);
equalTest(tests[i][0], 'MMMM', i);
equalTest(tests[i][1], 'MMMM', i);
equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
}
test.done();
},
"format" : function(test) {
test.expect(18);
moment.lang('da');
var a = [
['dddd \\den MMMM Do YYYY, h:mm:ss a', 'Søndag den Februar 14. 2010, 3:25:50 pm'],
['ddd hA', 'Søn 3PM'],
['M Mo MM MMMM MMM', '2 2. 02 Februar Feb'],
['YYYY YY', '2010 10'],
['D Do DD', '14 14. 14'],
['d do dddd ddd dd', '0 0. Søndag Søn Sø'],
['DDD DDDo DDDD', '45 45. 045'],
['w wo ww', '8 8. 08'],
['h hh', '3 03'],
['H HH', '15 15'],
['m mm', '25 25'],
['s ss', '50 50'],
['a A', 'pm PM'],
['[den] DDDo \\d\\ag på året', 'den 45. dag på året'],
['L', '14/02/2010'],
['LL', '14 Februar 2010'],
['LLL', '14 Februar 2010 3:25 PM'],
['LLLL', 'Søndag 14. Februar, 2010 3:25 PM']
],
b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
i;
for (i = 0; i < a.length; i++) {
test.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
}
test.done();
},
"format ordinal" : function(test) {
test.expect(31);
moment.lang('da');
test.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
test.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
test.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
test.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');
test.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');
test.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');
test.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');
test.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');
test.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');
test.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');
test.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');
test.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');
test.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');
test.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');
test.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');
test.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');
test.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');
test.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');
test.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');
test.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');
test.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');
test.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');
test.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');
test.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');
test.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');
test.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');
test.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');
test.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');
test.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');
test.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');
test.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');
test.done();
},
"format month" : function(test) {
test.expect(12);
moment.lang('da');
var expected = 'Januar Jan_Februar Feb_Marts Mar_April Apr_Maj Maj_Juni Jun_Juli Jul_August Aug_September Sep_Oktober Okt_November Nov_December Dec'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);
}
test.done();
},
"format week" : function(test) {
test.expect(7);
moment.lang('da');
var expected = 'Søndag Søn Sø_Mandag Man Ma_Tirsdag Tir Ti_Onsdag Ons On_Torsdag Tor To_Fredag Fre Fr_Lørdag Lør Lø'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);
}
test.done();
},
"from" : function(test) {
test.expect(30);
moment.lang('da');
var start = moment([2007, 1, 28]);
test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "få sekunder", "44 seconds = a few seconds");
test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "minut", "45 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "minut", "89 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutter", "90 seconds = 2 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutter", "44 minutes = 44 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "time", "45 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "time", "89 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 timer", "90 minutes = 2 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 timer", "5 hours = 5 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 timer", "21 hours = 21 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "dag", "22 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "dag", "35 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dage", "36 hours = 2 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "dag", "1 day = a day");
test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dage", "5 days = 5 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dage", "25 days = 25 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "månede", "26 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "månede", "30 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "månede", "45 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 måneder", "46 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 måneder", "75 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 måneder", "76 days = 3 months");
test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "månede", "1 month = a month");
test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 måneder", "5 months = 5 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 måneder", "344 days = 11 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "år", "345 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "år", "547 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 år", "548 days = 2 years");
test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "år", "1 year = a year");
test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 år", "5 years = 5 years");
test.done();
},
"suffix" : function(test) {
test.expect(2);
moment.lang('da');
test.equal(moment(30000).from(0), "om få sekunder", "prefix");
test.equal(moment(0).from(30000), "få sekunder siden", "suffix");
test.done();
},
"now from now" : function(test) {
test.expect(1);
moment.lang('da');
test.equal(moment().fromNow(), "få sekunder siden", "now from now should display as in the past");
test.done();
},
"fromNow" : function(test) {
test.expect(2);
moment.lang('da');
test.equal(moment().add({s:30}).fromNow(), "om få sekunder", "in a few seconds");
test.equal(moment().add({d:5}).fromNow(), "om 5 dage", "in 5 days");
test.done();
}
};

View File

@ -0,0 +1,241 @@
var moment = require("../../moment");
/**************************************************
German
*************************************************/
exports["lang:de"] = {
"parse" : function(test) {
test.expect(96);
moment.lang('de');
var tests = 'Januar Jan._Februar Febr._März Mrz._April Apr._Mai Mai_Juni Jun._Juli Jul._August Aug._September Sept._Oktober Okt._November Nov._Dezember Dez.'.split("_");
var i;
function equalTest(input, mmm, i) {
test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
}
for (i = 0; i < 12; i++) {
tests[i] = tests[i].split(' ');
equalTest(tests[i][0], 'MMM', i);
equalTest(tests[i][1], 'MMM', i);
equalTest(tests[i][0], 'MMMM', i);
equalTest(tests[i][1], 'MMMM', i);
equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
}
test.done();
},
"format" : function(test) {
test.expect(18);
moment.lang('de');
var a = [
['dddd, Do MMMM YYYY, h:mm:ss a', 'Sonntag, 14. Februar 2010, 3:25:50 pm'],
['ddd, hA', 'So., 3PM'],
['M Mo MM MMMM MMM', '2 2. 02 Februar Febr.'],
['YYYY YY', '2010 10'],
['D Do DD', '14 14. 14'],
['d do dddd ddd dd', '0 0. Sonntag So. So'],
['DDD DDDo DDDD', '45 45. 045'],
['w wo ww', '8 8. 08'],
['h hh', '3 03'],
['H HH', '15 15'],
['m mm', '25 25'],
['s ss', '50 50'],
['a A', 'pm PM'],
['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45. day of the year'],
['L', '14.02.2010'],
['LL', '14. Februar 2010'],
['LLL', '14. Februar 2010 15:25 Uhr'],
['LLLL', 'Sonntag, 14. Februar 2010 15:25 Uhr']
],
b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
i;
for (i = 0; i < a.length; i++) {
test.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
}
test.done();
},
"format ordinal" : function(test) {
test.expect(31);
moment.lang('de');
test.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
test.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
test.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
test.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');
test.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');
test.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');
test.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');
test.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');
test.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');
test.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');
test.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');
test.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');
test.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');
test.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');
test.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');
test.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');
test.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');
test.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');
test.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');
test.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');
test.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');
test.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');
test.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');
test.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');
test.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');
test.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');
test.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');
test.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');
test.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');
test.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');
test.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');
test.done();
},
"format month" : function(test) {
test.expect(12);
moment.lang('de');
var expected = 'Januar Jan._Februar Febr._März Mrz._April Apr._Mai Mai_Juni Jun._Juli Jul._August Aug._September Sept._Oktober Okt._November Nov._Dezember Dez.'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);
}
test.done();
},
"format week" : function(test) {
test.expect(7);
moment.lang('de');
var expected = 'Sonntag So. So_Montag Mo. Mo_Dienstag Di. Di_Mittwoch Mi. Mi_Donnerstag Do. Do_Freitag Fr. Fr_Samstag Sa. Sa'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);
}
test.done();
},
"from" : function(test) {
test.expect(30);
moment.lang('de');
var start = moment([2007, 1, 28]);
test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "ein paar Sekunden", "44 seconds = a few seconds");
test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "einer Minute", "45 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "einer Minute", "89 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 Minuten", "90 seconds = 2 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 Minuten", "44 minutes = 44 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "einer Stunde", "45 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "einer Stunde", "89 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 Stunden", "90 minutes = 2 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 Stunden", "5 hours = 5 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 Stunden", "21 hours = 21 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "einem Tag", "22 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "einem Tag", "35 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 Tagen", "36 hours = 2 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "einem Tag", "1 day = a day");
test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 Tagen", "5 days = 5 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 Tagen", "25 days = 25 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "einem Monat", "26 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "einem Monat", "30 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "einem Monat", "45 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 Monaten", "46 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 Monaten", "75 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 Monaten", "76 days = 3 months");
test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "einem Monat", "1 month = a month");
test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 Monaten", "5 months = 5 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 Monaten", "344 days = 11 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "einem Jahr", "345 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "einem Jahr", "547 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 Jahren", "548 days = 2 years");
test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "einem Jahr", "1 year = a year");
test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 Jahren", "5 years = 5 years");
test.done();
},
"suffix" : function(test) {
test.expect(2);
moment.lang('de');
test.equal(moment(30000).from(0), "in ein paar Sekunden", "prefix");
test.equal(moment(0).from(30000), "vor ein paar Sekunden", "suffix");
test.done();
},
"fromNow" : function(test) {
test.expect(2);
moment.lang('de');
test.equal(moment().add({s:30}).fromNow(), "in ein paar Sekunden", "in a few seconds");
test.equal(moment().add({d:5}).fromNow(), "in 5 Tagen", "in 5 days");
test.done();
},
"calendar day" : function(test) {
test.expect(6);
moment.lang('de');
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Heute um 2:00 Uhr", "today at the same time");
test.equal(moment(a).add({ m: 25 }).calendar(), "Heute um 2:25 Uhr", "Now plus 25 min");
test.equal(moment(a).add({ h: 1 }).calendar(), "Heute um 3:00 Uhr", "Now plus 1 hour");
test.equal(moment(a).add({ d: 1 }).calendar(), "Morgen um 2:00 Uhr", "tomorrow at the same time");
test.equal(moment(a).subtract({ h: 1 }).calendar(), "Heute um 1:00 Uhr", "Now minus 1 hour");
test.equal(moment(a).subtract({ d: 1 }).calendar(), "Gestern um 2:00 Uhr", "yesterday at the same time");
test.done();
},
"calendar next week" : function(test) {
test.expect(15);
moment.lang('de');
var i;
var m;
for (i = 2; i < 7; i++) {
m = moment().add({ d: i });
test.equal(m.calendar(), m.format('dddd [um] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [um] LT'), "Today + " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('dddd [um] LT'), "Today + " + i + " days end of day");
}
test.done();
},
"calendar last week" : function(test) {
test.expect(15);
moment.lang('de');
for (i = 2; i < 7; i++) {
m = moment().subtract({ d: i });
test.equal(m.calendar(), m.format('[letzten] dddd [um] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[letzten] dddd [um] LT'), "Today + " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('[letzten] dddd [um] LT'), "Today + " + i + " days end of day");
}
test.done();
},
"calendar all else" : function(test) {
test.expect(4);
moment.lang('de');
var weeksAgo = moment().subtract({ w: 1 });
var weeksFromNow = moment().add({ w: 1 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
weeksAgo = moment().subtract({ w: 2 });
weeksFromNow = moment().add({ w: 2 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
test.done();
}
};

View File

@ -0,0 +1,248 @@
var moment = require("../../moment");
/**************************************************
English
*************************************************/
exports["lang:en-ca"] = {
"parse" : function(test) {
test.expect(96);
moment.lang('en-ca');
var tests = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split("_");
var i;
function equalTest(input, mmm, i) {
test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
}
for (i = 0; i < 12; i++) {
tests[i] = tests[i].split(' ');
equalTest(tests[i][0], 'MMM', i);
equalTest(tests[i][1], 'MMM', i);
equalTest(tests[i][0], 'MMMM', i);
equalTest(tests[i][1], 'MMMM', i);
equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
}
test.done();
},
"format" : function(test) {
test.expect(18);
moment.lang('en-ca');
var a = [
['dddd, MMMM Do YYYY, h:mm:ss a', 'Sunday, February 14th 2010, 3:25:50 pm'],
['ddd, hA', 'Sun, 3PM'],
['M Mo MM MMMM MMM', '2 2nd 02 February Feb'],
['YYYY YY', '2010 10'],
['D Do DD', '14 14th 14'],
['d do dddd ddd dd', '0 0th Sunday Sun Su'],
['DDD DDDo DDDD', '45 45th 045'],
['w wo ww', '8 8th 08'],
['h hh', '3 03'],
['H HH', '15 15'],
['m mm', '25 25'],
['s ss', '50 50'],
['a A', 'pm PM'],
['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45th day of the year'],
['L', '2010-02-14'],
['LL', '14 February, 2010'],
['LLL', '14 February, 2010 3:25 PM'],
['LLLL', 'Sunday, 14 February, 2010 3:25 PM']
],
b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
i;
for (i = 0; i < a.length; i++) {
test.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
}
test.done();
},
"format ordinal" : function(test) {
test.expect(31);
moment.lang('en-gb');
test.equal(moment([2011, 0, 1]).format('DDDo'), '1st', '1st');
test.equal(moment([2011, 0, 2]).format('DDDo'), '2nd', '2nd');
test.equal(moment([2011, 0, 3]).format('DDDo'), '3rd', '3rd');
test.equal(moment([2011, 0, 4]).format('DDDo'), '4th', '4th');
test.equal(moment([2011, 0, 5]).format('DDDo'), '5th', '5th');
test.equal(moment([2011, 0, 6]).format('DDDo'), '6th', '6th');
test.equal(moment([2011, 0, 7]).format('DDDo'), '7th', '7th');
test.equal(moment([2011, 0, 8]).format('DDDo'), '8th', '8th');
test.equal(moment([2011, 0, 9]).format('DDDo'), '9th', '9th');
test.equal(moment([2011, 0, 10]).format('DDDo'), '10th', '10th');
test.equal(moment([2011, 0, 11]).format('DDDo'), '11th', '11th');
test.equal(moment([2011, 0, 12]).format('DDDo'), '12th', '12th');
test.equal(moment([2011, 0, 13]).format('DDDo'), '13th', '13th');
test.equal(moment([2011, 0, 14]).format('DDDo'), '14th', '14th');
test.equal(moment([2011, 0, 15]).format('DDDo'), '15th', '15th');
test.equal(moment([2011, 0, 16]).format('DDDo'), '16th', '16th');
test.equal(moment([2011, 0, 17]).format('DDDo'), '17th', '17th');
test.equal(moment([2011, 0, 18]).format('DDDo'), '18th', '18th');
test.equal(moment([2011, 0, 19]).format('DDDo'), '19th', '19th');
test.equal(moment([2011, 0, 20]).format('DDDo'), '20th', '20th');
test.equal(moment([2011, 0, 21]).format('DDDo'), '21st', '21st');
test.equal(moment([2011, 0, 22]).format('DDDo'), '22nd', '22nd');
test.equal(moment([2011, 0, 23]).format('DDDo'), '23rd', '23rd');
test.equal(moment([2011, 0, 24]).format('DDDo'), '24th', '24th');
test.equal(moment([2011, 0, 25]).format('DDDo'), '25th', '25th');
test.equal(moment([2011, 0, 26]).format('DDDo'), '26th', '26th');
test.equal(moment([2011, 0, 27]).format('DDDo'), '27th', '27th');
test.equal(moment([2011, 0, 28]).format('DDDo'), '28th', '28th');
test.equal(moment([2011, 0, 29]).format('DDDo'), '29th', '29th');
test.equal(moment([2011, 0, 30]).format('DDDo'), '30th', '30th');
test.equal(moment([2011, 0, 31]).format('DDDo'), '31st', '31st');
test.done();
},
"format month" : function(test) {
test.expect(12);
moment.lang('en-gb');
var expected = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);
}
test.done();
},
"format week" : function(test) {
test.expect(7);
moment.lang('en-gb');
var expected = 'Sunday Sun Su_Monday Mon Mo_Tuesday Tue Tu_Wednesday Wed We_Thursday Thu Th_Friday Fri Fr_Saturday Sat Sa'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);
}
test.done();
},
"from" : function(test) {
test.expect(30);
moment.lang('en-gb');
var start = moment([2007, 1, 28]);
test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "a few seconds", "44 seconds = a few seconds");
test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "a minute", "45 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "a minute", "89 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutes", "90 seconds = 2 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutes", "44 minutes = 44 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "an hour", "45 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "an hour", "89 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 hours", "90 minutes = 2 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 hours", "5 hours = 5 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 hours", "21 hours = 21 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "a day", "22 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "a day", "35 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 days", "36 hours = 2 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "a day", "1 day = a day");
test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 days", "5 days = 5 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 days", "25 days = 25 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "a month", "26 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "a month", "30 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "a month", "45 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 months", "46 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 months", "75 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 months", "76 days = 3 months");
test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "a month", "1 month = a month");
test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 months", "5 months = 5 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 months", "344 days = 11 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "a year", "345 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "a year", "547 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 years", "548 days = 2 years");
test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "a year", "1 year = a year");
test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 years", "5 years = 5 years");
test.done();
},
"suffix" : function(test) {
test.expect(2);
moment.lang('en-gb');
test.equal(moment(30000).from(0), "in a few seconds", "prefix");
test.equal(moment(0).from(30000), "a few seconds ago", "suffix");
test.done();
},
"now from now" : function(test) {
test.expect(1);
moment.lang('en-gb');
test.equal(moment().fromNow(), "a few seconds ago", "now from now should display as in the past");
test.done();
},
"fromNow" : function(test) {
test.expect(2);
moment.lang('en-gb');
test.equal(moment().add({s:30}).fromNow(), "in a few seconds", "in a few seconds");
test.equal(moment().add({d:5}).fromNow(), "in 5 days", "in 5 days");
test.done();
},
"calendar day" : function(test) {
test.expect(6);
moment.lang('en-gb');
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Today at 2:00 AM", "today at the same time");
test.equal(moment(a).add({ m: 25 }).calendar(), "Today at 2:25 AM", "Now plus 25 min");
test.equal(moment(a).add({ h: 1 }).calendar(), "Today at 3:00 AM", "Now plus 1 hour");
test.equal(moment(a).add({ d: 1 }).calendar(), "Tomorrow at 2:00 AM", "tomorrow at the same time");
test.equal(moment(a).subtract({ h: 1 }).calendar(), "Today at 1:00 AM", "Now minus 1 hour");
test.equal(moment(a).subtract({ d: 1 }).calendar(), "Yesterday at 2:00 AM", "yesterday at the same time");
test.done();
},
"calendar next week" : function(test) {
test.expect(15);
moment.lang('en-gb');
var i;
var m;
for (i = 2; i < 7; i++) {
m = moment().add({ d: i });
test.equal(m.calendar(), m.format('dddd [at] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [at] LT'), "Today + " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('dddd [at] LT'), "Today + " + i + " days end of day");
}
test.done();
},
"calendar last week" : function(test) {
test.expect(15);
moment.lang('en-gb');
for (i = 2; i < 7; i++) {
m = moment().subtract({ d: i });
test.equal(m.calendar(), m.format('[last] dddd [at] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[last] dddd [at] LT'), "Today - " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('[last] dddd [at] LT'), "Today - " + i + " days end of day");
}
test.done();
},
"calendar all else" : function(test) {
test.expect(4);
moment.lang('en-gb');
var weeksAgo = moment().subtract({ w: 1 });
var weeksFromNow = moment().add({ w: 1 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
weeksAgo = moment().subtract({ w: 2 });
weeksFromNow = moment().add({ w: 2 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
test.done();
}
};

View File

@ -0,0 +1,248 @@
var moment = require("../../moment");
/**************************************************
English
*************************************************/
exports["lang:en-gb"] = {
"parse" : function(test) {
test.expect(96);
moment.lang('en-gb');
var tests = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split("_");
var i;
function equalTest(input, mmm, i) {
test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
}
for (i = 0; i < 12; i++) {
tests[i] = tests[i].split(' ');
equalTest(tests[i][0], 'MMM', i);
equalTest(tests[i][1], 'MMM', i);
equalTest(tests[i][0], 'MMMM', i);
equalTest(tests[i][1], 'MMMM', i);
equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
}
test.done();
},
"format" : function(test) {
test.expect(18);
moment.lang('en-gb');
var a = [
['dddd, MMMM Do YYYY, h:mm:ss a', 'Sunday, February 14th 2010, 3:25:50 pm'],
['ddd, hA', 'Sun, 3PM'],
['M Mo MM MMMM MMM', '2 2nd 02 February Feb'],
['YYYY YY', '2010 10'],
['D Do DD', '14 14th 14'],
['d do dddd ddd dd', '0 0th Sunday Sun Su'],
['DDD DDDo DDDD', '45 45th 045'],
['w wo ww', '8 8th 08'],
['h hh', '3 03'],
['H HH', '15 15'],
['m mm', '25 25'],
['s ss', '50 50'],
['a A', 'pm PM'],
['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45th day of the year'],
['L', '14/02/2010'],
['LL', '14 February 2010'],
['LLL', '14 February 2010 3:25 PM'],
['LLLL', 'Sunday, 14 February 2010 3:25 PM']
],
b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
i;
for (i = 0; i < a.length; i++) {
test.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
}
test.done();
},
"format ordinal" : function(test) {
test.expect(31);
moment.lang('en-gb');
test.equal(moment([2011, 0, 1]).format('DDDo'), '1st', '1st');
test.equal(moment([2011, 0, 2]).format('DDDo'), '2nd', '2nd');
test.equal(moment([2011, 0, 3]).format('DDDo'), '3rd', '3rd');
test.equal(moment([2011, 0, 4]).format('DDDo'), '4th', '4th');
test.equal(moment([2011, 0, 5]).format('DDDo'), '5th', '5th');
test.equal(moment([2011, 0, 6]).format('DDDo'), '6th', '6th');
test.equal(moment([2011, 0, 7]).format('DDDo'), '7th', '7th');
test.equal(moment([2011, 0, 8]).format('DDDo'), '8th', '8th');
test.equal(moment([2011, 0, 9]).format('DDDo'), '9th', '9th');
test.equal(moment([2011, 0, 10]).format('DDDo'), '10th', '10th');
test.equal(moment([2011, 0, 11]).format('DDDo'), '11th', '11th');
test.equal(moment([2011, 0, 12]).format('DDDo'), '12th', '12th');
test.equal(moment([2011, 0, 13]).format('DDDo'), '13th', '13th');
test.equal(moment([2011, 0, 14]).format('DDDo'), '14th', '14th');
test.equal(moment([2011, 0, 15]).format('DDDo'), '15th', '15th');
test.equal(moment([2011, 0, 16]).format('DDDo'), '16th', '16th');
test.equal(moment([2011, 0, 17]).format('DDDo'), '17th', '17th');
test.equal(moment([2011, 0, 18]).format('DDDo'), '18th', '18th');
test.equal(moment([2011, 0, 19]).format('DDDo'), '19th', '19th');
test.equal(moment([2011, 0, 20]).format('DDDo'), '20th', '20th');
test.equal(moment([2011, 0, 21]).format('DDDo'), '21st', '21st');
test.equal(moment([2011, 0, 22]).format('DDDo'), '22nd', '22nd');
test.equal(moment([2011, 0, 23]).format('DDDo'), '23rd', '23rd');
test.equal(moment([2011, 0, 24]).format('DDDo'), '24th', '24th');
test.equal(moment([2011, 0, 25]).format('DDDo'), '25th', '25th');
test.equal(moment([2011, 0, 26]).format('DDDo'), '26th', '26th');
test.equal(moment([2011, 0, 27]).format('DDDo'), '27th', '27th');
test.equal(moment([2011, 0, 28]).format('DDDo'), '28th', '28th');
test.equal(moment([2011, 0, 29]).format('DDDo'), '29th', '29th');
test.equal(moment([2011, 0, 30]).format('DDDo'), '30th', '30th');
test.equal(moment([2011, 0, 31]).format('DDDo'), '31st', '31st');
test.done();
},
"format month" : function(test) {
test.expect(12);
moment.lang('en-gb');
var expected = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);
}
test.done();
},
"format week" : function(test) {
test.expect(7);
moment.lang('en-gb');
var expected = 'Sunday Sun Su_Monday Mon Mo_Tuesday Tue Tu_Wednesday Wed We_Thursday Thu Th_Friday Fri Fr_Saturday Sat Sa'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);
}
test.done();
},
"from" : function(test) {
test.expect(30);
moment.lang('en-gb');
var start = moment([2007, 1, 28]);
test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "a few seconds", "44 seconds = a few seconds");
test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "a minute", "45 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "a minute", "89 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutes", "90 seconds = 2 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutes", "44 minutes = 44 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "an hour", "45 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "an hour", "89 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 hours", "90 minutes = 2 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 hours", "5 hours = 5 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 hours", "21 hours = 21 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "a day", "22 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "a day", "35 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 days", "36 hours = 2 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "a day", "1 day = a day");
test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 days", "5 days = 5 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 days", "25 days = 25 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "a month", "26 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "a month", "30 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "a month", "45 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 months", "46 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 months", "75 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 months", "76 days = 3 months");
test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "a month", "1 month = a month");
test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 months", "5 months = 5 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 months", "344 days = 11 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "a year", "345 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "a year", "547 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 years", "548 days = 2 years");
test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "a year", "1 year = a year");
test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 years", "5 years = 5 years");
test.done();
},
"suffix" : function(test) {
test.expect(2);
moment.lang('en-gb');
test.equal(moment(30000).from(0), "in a few seconds", "prefix");
test.equal(moment(0).from(30000), "a few seconds ago", "suffix");
test.done();
},
"now from now" : function(test) {
test.expect(1);
moment.lang('en-gb');
test.equal(moment().fromNow(), "a few seconds ago", "now from now should display as in the past");
test.done();
},
"fromNow" : function(test) {
test.expect(2);
moment.lang('en-gb');
test.equal(moment().add({s:30}).fromNow(), "in a few seconds", "in a few seconds");
test.equal(moment().add({d:5}).fromNow(), "in 5 days", "in 5 days");
test.done();
},
"calendar day" : function(test) {
test.expect(6);
moment.lang('en-gb');
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Today at 2:00 AM", "today at the same time");
test.equal(moment(a).add({ m: 25 }).calendar(), "Today at 2:25 AM", "Now plus 25 min");
test.equal(moment(a).add({ h: 1 }).calendar(), "Today at 3:00 AM", "Now plus 1 hour");
test.equal(moment(a).add({ d: 1 }).calendar(), "Tomorrow at 2:00 AM", "tomorrow at the same time");
test.equal(moment(a).subtract({ h: 1 }).calendar(), "Today at 1:00 AM", "Now minus 1 hour");
test.equal(moment(a).subtract({ d: 1 }).calendar(), "Yesterday at 2:00 AM", "yesterday at the same time");
test.done();
},
"calendar next week" : function(test) {
test.expect(15);
moment.lang('en-gb');
var i;
var m;
for (i = 2; i < 7; i++) {
m = moment().add({ d: i });
test.equal(m.calendar(), m.format('dddd [at] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [at] LT'), "Today + " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('dddd [at] LT'), "Today + " + i + " days end of day");
}
test.done();
},
"calendar last week" : function(test) {
test.expect(15);
moment.lang('en-gb');
for (i = 2; i < 7; i++) {
m = moment().subtract({ d: i });
test.equal(m.calendar(), m.format('[last] dddd [at] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[last] dddd [at] LT'), "Today - " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('[last] dddd [at] LT'), "Today - " + i + " days end of day");
}
test.done();
},
"calendar all else" : function(test) {
test.expect(4);
moment.lang('en-gb');
var weeksAgo = moment().subtract({ w: 1 });
var weeksFromNow = moment().add({ w: 1 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
weeksAgo = moment().subtract({ w: 2 });
weeksFromNow = moment().add({ w: 2 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
test.done();
}
};

View File

@ -0,0 +1,248 @@
var moment = require("../../moment");
/**************************************************
English
*************************************************/
exports["lang:en"] = {
"parse" : function(test) {
test.expect(96);
moment.lang('en');
var tests = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split("_");
var i;
function equalTest(input, mmm, i) {
test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
}
for (i = 0; i < 12; i++) {
tests[i] = tests[i].split(' ');
equalTest(tests[i][0], 'MMM', i);
equalTest(tests[i][1], 'MMM', i);
equalTest(tests[i][0], 'MMMM', i);
equalTest(tests[i][1], 'MMMM', i);
equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
}
test.done();
},
"format" : function(test) {
test.expect(18);
moment.lang('en');
var a = [
['dddd, MMMM Do YYYY, h:mm:ss a', 'Sunday, February 14th 2010, 3:25:50 pm'],
['ddd, hA', 'Sun, 3PM'],
['M Mo MM MMMM MMM', '2 2nd 02 February Feb'],
['YYYY YY', '2010 10'],
['D Do DD', '14 14th 14'],
['d do dddd ddd dd', '0 0th Sunday Sun Su'],
['DDD DDDo DDDD', '45 45th 045'],
['w wo ww', '8 8th 08'],
['h hh', '3 03'],
['H HH', '15 15'],
['m mm', '25 25'],
['s ss', '50 50'],
['a A', 'pm PM'],
['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45th day of the year'],
['L', '02/14/2010'],
['LL', 'February 14 2010'],
['LLL', 'February 14 2010 3:25 PM'],
['LLLL', 'Sunday, February 14 2010 3:25 PM']
],
b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
i;
for (i = 0; i < a.length; i++) {
test.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
}
test.done();
},
"format ordinal" : function(test) {
test.expect(31);
moment.lang('en');
test.equal(moment([2011, 0, 1]).format('DDDo'), '1st', '1st');
test.equal(moment([2011, 0, 2]).format('DDDo'), '2nd', '2nd');
test.equal(moment([2011, 0, 3]).format('DDDo'), '3rd', '3rd');
test.equal(moment([2011, 0, 4]).format('DDDo'), '4th', '4th');
test.equal(moment([2011, 0, 5]).format('DDDo'), '5th', '5th');
test.equal(moment([2011, 0, 6]).format('DDDo'), '6th', '6th');
test.equal(moment([2011, 0, 7]).format('DDDo'), '7th', '7th');
test.equal(moment([2011, 0, 8]).format('DDDo'), '8th', '8th');
test.equal(moment([2011, 0, 9]).format('DDDo'), '9th', '9th');
test.equal(moment([2011, 0, 10]).format('DDDo'), '10th', '10th');
test.equal(moment([2011, 0, 11]).format('DDDo'), '11th', '11th');
test.equal(moment([2011, 0, 12]).format('DDDo'), '12th', '12th');
test.equal(moment([2011, 0, 13]).format('DDDo'), '13th', '13th');
test.equal(moment([2011, 0, 14]).format('DDDo'), '14th', '14th');
test.equal(moment([2011, 0, 15]).format('DDDo'), '15th', '15th');
test.equal(moment([2011, 0, 16]).format('DDDo'), '16th', '16th');
test.equal(moment([2011, 0, 17]).format('DDDo'), '17th', '17th');
test.equal(moment([2011, 0, 18]).format('DDDo'), '18th', '18th');
test.equal(moment([2011, 0, 19]).format('DDDo'), '19th', '19th');
test.equal(moment([2011, 0, 20]).format('DDDo'), '20th', '20th');
test.equal(moment([2011, 0, 21]).format('DDDo'), '21st', '21st');
test.equal(moment([2011, 0, 22]).format('DDDo'), '22nd', '22nd');
test.equal(moment([2011, 0, 23]).format('DDDo'), '23rd', '23rd');
test.equal(moment([2011, 0, 24]).format('DDDo'), '24th', '24th');
test.equal(moment([2011, 0, 25]).format('DDDo'), '25th', '25th');
test.equal(moment([2011, 0, 26]).format('DDDo'), '26th', '26th');
test.equal(moment([2011, 0, 27]).format('DDDo'), '27th', '27th');
test.equal(moment([2011, 0, 28]).format('DDDo'), '28th', '28th');
test.equal(moment([2011, 0, 29]).format('DDDo'), '29th', '29th');
test.equal(moment([2011, 0, 30]).format('DDDo'), '30th', '30th');
test.equal(moment([2011, 0, 31]).format('DDDo'), '31st', '31st');
test.done();
},
"format month" : function(test) {
test.expect(12);
moment.lang('en');
var expected = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);
}
test.done();
},
"format week" : function(test) {
test.expect(7);
moment.lang('en');
var expected = 'Sunday Sun Su_Monday Mon Mo_Tuesday Tue Tu_Wednesday Wed We_Thursday Thu Th_Friday Fri Fr_Saturday Sat Sa'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);
}
test.done();
},
"from" : function(test) {
test.expect(30);
moment.lang('en');
var start = moment([2007, 1, 28]);
test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "a few seconds", "44 seconds = a few seconds");
test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "a minute", "45 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "a minute", "89 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutes", "90 seconds = 2 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutes", "44 minutes = 44 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "an hour", "45 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "an hour", "89 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 hours", "90 minutes = 2 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 hours", "5 hours = 5 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 hours", "21 hours = 21 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "a day", "22 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "a day", "35 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 days", "36 hours = 2 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "a day", "1 day = a day");
test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 days", "5 days = 5 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 days", "25 days = 25 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "a month", "26 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "a month", "30 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "a month", "45 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 months", "46 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 months", "75 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 months", "76 days = 3 months");
test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "a month", "1 month = a month");
test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 months", "5 months = 5 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 months", "344 days = 11 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "a year", "345 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "a year", "547 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 years", "548 days = 2 years");
test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "a year", "1 year = a year");
test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 years", "5 years = 5 years");
test.done();
},
"suffix" : function(test) {
test.expect(2);
moment.lang('en');
test.equal(moment(30000).from(0), "in a few seconds", "prefix");
test.equal(moment(0).from(30000), "a few seconds ago", "suffix");
test.done();
},
"now from now" : function(test) {
test.expect(1);
moment.lang('en');
test.equal(moment().fromNow(), "a few seconds ago", "now from now should display as in the past");
test.done();
},
"fromNow" : function(test) {
test.expect(2);
moment.lang('en');
test.equal(moment().add({s:30}).fromNow(), "in a few seconds", "in a few seconds");
test.equal(moment().add({d:5}).fromNow(), "in 5 days", "in 5 days");
test.done();
},
"calendar day" : function(test) {
test.expect(6);
moment.lang('en');
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Today at 2:00 AM", "today at the same time");
test.equal(moment(a).add({ m: 25 }).calendar(), "Today at 2:25 AM", "Now plus 25 min");
test.equal(moment(a).add({ h: 1 }).calendar(), "Today at 3:00 AM", "Now plus 1 hour");
test.equal(moment(a).add({ d: 1 }).calendar(), "Tomorrow at 2:00 AM", "tomorrow at the same time");
test.equal(moment(a).subtract({ h: 1 }).calendar(), "Today at 1:00 AM", "Now minus 1 hour");
test.equal(moment(a).subtract({ d: 1 }).calendar(), "Yesterday at 2:00 AM", "yesterday at the same time");
test.done();
},
"calendar next week" : function(test) {
test.expect(15);
moment.lang('en');
var i;
var m;
for (i = 2; i < 7; i++) {
m = moment().add({ d: i });
test.equal(m.calendar(), m.format('dddd [at] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [at] LT'), "Today + " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('dddd [at] LT'), "Today + " + i + " days end of day");
}
test.done();
},
"calendar last week" : function(test) {
test.expect(15);
moment.lang('en');
for (i = 2; i < 7; i++) {
m = moment().subtract({ d: i });
test.equal(m.calendar(), m.format('[last] dddd [at] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[last] dddd [at] LT'), "Today - " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('[last] dddd [at] LT'), "Today - " + i + " days end of day");
}
test.done();
},
"calendar all else" : function(test) {
test.expect(4);
moment.lang('en');
var weeksAgo = moment().subtract({ w: 1 });
var weeksFromNow = moment().add({ w: 1 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
weeksAgo = moment().subtract({ w: 2 });
weeksFromNow = moment().add({ w: 2 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
test.done();
}
};

View File

@ -0,0 +1,218 @@
var moment = require("../../moment");
/**************************************************
Spanish
*************************************************/
exports["lang:es"] = {
"parse" : function(test) {
test.expect(96);
moment.lang('es');
var tests = 'Enero Ene._Febrero Feb._Marzo Mar._Abril Abr._Mayo May._Junio Jun._Julio Jul._Agosto Ago._Septiembre Sep._Octubre Oct._Noviembre Nov._Diciembre Dic.'.split("_");
var i;
function equalTest(input, mmm, i) {
test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
}
for (i = 0; i < 12; i++) {
tests[i] = tests[i].split(' ');
equalTest(tests[i][0], 'MMM', i);
equalTest(tests[i][1], 'MMM', i);
equalTest(tests[i][0], 'MMMM', i);
equalTest(tests[i][1], 'MMMM', i);
equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
}
test.done();
},
"format ordinal" : function(test) {
test.expect(31);
moment.lang('es');
test.equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
test.equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º');
test.equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º');
test.equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º');
test.equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º');
test.equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º');
test.equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º');
test.equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º');
test.equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º');
test.equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º');
test.equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º');
test.equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º');
test.equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º');
test.equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º');
test.equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º');
test.equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º');
test.equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º');
test.equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º');
test.equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º');
test.equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º');
test.equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º');
test.equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º');
test.equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º');
test.equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º');
test.equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º');
test.equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º');
test.equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º');
test.equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º');
test.equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º');
test.equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º');
test.equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º');
test.done();
},
"format month" : function(test) {
test.expect(12);
moment.lang('es');
var expected = 'Enero Ene._Febrero Feb._Marzo Mar._Abril Abr._Mayo May._Junio Jun._Julio Jul._Agosto Ago._Septiembre Sep._Octubre Oct._Noviembre Nov._Diciembre Dic.'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);
}
test.done();
},
"format week" : function(test) {
test.expect(7);
moment.lang('es');
var expected = 'Domingo Dom. Do_Lunes Lun. Lu_Martes Mar. Ma_Miércoles Mié. Mi_Jueves Jue. Ju_Viernes Vie. Vi_Sábado Sáb. Sá'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);
}
test.done();
},
"from" : function(test) {
test.expect(30);
moment.lang('es');
var start = moment([2007, 1, 28]);
test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "unos segundos", "44 seconds = a few seconds");
test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "un minuto", "45 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "un minuto", "89 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutos", "90 seconds = 2 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutos", "44 minutes = 44 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "una hora", "45 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "una hora", "89 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 horas", "90 minutes = 2 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 horas", "5 hours = 5 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 horas", "21 hours = 21 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "un día", "22 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "un día", "35 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 días", "36 hours = 2 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "un día", "1 day = a day");
test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 días", "5 days = 5 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 días", "25 days = 25 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "un mes", "26 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "un mes", "30 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "un mes", "45 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 meses", "46 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 meses", "75 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 meses", "76 days = 3 months");
test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "un mes", "1 month = a month");
test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 meses", "5 months = 5 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 meses", "344 days = 11 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "un año", "345 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "un año", "547 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 años", "548 days = 2 years");
test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "un año", "1 year = a year");
test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 años", "5 years = 5 years");
test.done();
},
"suffix" : function(test) {
test.expect(2);
moment.lang('es');
test.equal(moment(30000).from(0), "en unos segundos", "prefix");
test.equal(moment(0).from(30000), "hace unos segundos", "suffix");
test.done();
},
"now from now" : function(test) {
test.expect(1);
moment.lang('es');
test.equal(moment().fromNow(), "hace unos segundos", "now from now should display as in the past");
test.done();
},
"fromNow" : function(test) {
test.expect(2);
moment.lang('es');
test.equal(moment().add({s:30}).fromNow(), "en unos segundos", "en unos segundos");
test.equal(moment().add({d:5}).fromNow(), "en 5 días", "en 5 días");
test.done();
},
"calendar day" : function(test) {
test.expect(7);
moment.lang('es');
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "hoy a las 2:00", "today at the same time");
test.equal(moment(a).add({ m: 25 }).calendar(), "hoy a las 2:25", "Now plus 25 min");
test.equal(moment(a).add({ h: 1 }).calendar(), "hoy a las 3:00", "Now plus 1 hour");
test.equal(moment(a).add({ d: 1 }).calendar(), "mañana a las 2:00", "tomorrow at the same time");
test.equal(moment(a).add({ d: 1, h : -1 }).calendar(), "mañana a la 1:00", "tomorrow minus 1 hour");
test.equal(moment(a).subtract({ h: 1 }).calendar(), "hoy a la 1:00", "Now minus 1 hour");
test.equal(moment(a).subtract({ d: 1 }).calendar(), "ayer a las 2:00", "yesterday at the same time");
test.done();
},
"calendar next week" : function(test) {
test.expect(15);
moment.lang('es');
var i;
var m;
for (i = 2; i < 7; i++) {
m = moment().add({ d: i });
test.equal(m.calendar(), m.format('dddd [a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), "Today + " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('dddd [a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), "Today + " + i + " days end of day");
}
test.done();
},
"calendar last week" : function(test) {
test.expect(15);
moment.lang('es');
for (i = 2; i < 7; i++) {
m = moment().subtract({ d: i });
test.equal(m.calendar(), m.format('[el] dddd [pasado a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[el] dddd [pasado a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), "Today - " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('[el] dddd [pasado a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), "Today - " + i + " days end of day");
}
test.done();
},
"calendar all else" : function(test) {
test.expect(4);
moment.lang('es');
var weeksAgo = moment().subtract({ w: 1 });
var weeksFromNow = moment().add({ w: 1 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
weeksAgo = moment().subtract({ w: 2 });
weeksFromNow = moment().add({ w: 2 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
test.done();
}
};

View File

@ -0,0 +1,248 @@
var moment = require("../../moment");
/**************************************************
Euskara
*************************************************/
exports["lang:eu"] = {
"parse" : function(test) {
test.expect(96);
moment.lang('eu');
var tests = 'urtarrila urt._otsaila ots._martxoa mar._apirila api._maiatza mai._ekaina eka._uztaila uzt._abuztua abu._iraila ira._urria urr._azaroa aza._abendua abe.'.split("_");
var i;
function equalTest(input, mmm, i) {
test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
}
for (i = 0; i < 12; i++) {
tests[i] = tests[i].split(' ');
equalTest(tests[i][0], 'MMM', i);
equalTest(tests[i][1], 'MMM', i);
equalTest(tests[i][0], 'MMMM', i);
equalTest(tests[i][1], 'MMMM', i);
equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
}
test.done();
},
"format" : function(test) {
test.expect(18);
moment.lang('eu');
var a = [
['dddd, MMMM Do YYYY, h:mm:ss a', 'igandea, otsaila 14. 2010, 3:25:50 pm'],
['ddd, hA', 'ig., 3PM'],
['M Mo MM MMMM MMM', '2 2. 02 otsaila ots.'],
['YYYY YY', '2010 10'],
['D Do DD', '14 14. 14'],
['d do dddd ddd dd', '0 0. igandea ig. ig'],
['DDD DDDo DDDD', '45 45. 045'],
['w wo ww', '8 8. 08'],
['h hh', '3 03'],
['H HH', '15 15'],
['m mm', '25 25'],
['s ss', '50 50'],
['a A', 'pm PM'],
['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45. day of the year'],
['L', '2010-02-14'],
['LL', '2010ko otsailaren 14a'],
['LLL', '2010ko otsailaren 14a 15:25'],
['LLLL', 'igandea, 2010ko otsailaren 14a 15:25']
],
b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
i;
for (i = 0; i < a.length; i++) {
test.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
}
test.done();
},
"format ordinal" : function(test) {
test.expect(31);
moment.lang('eu');
test.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
test.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
test.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
test.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');
test.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');
test.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');
test.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');
test.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');
test.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');
test.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');
test.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');
test.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');
test.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');
test.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');
test.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');
test.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');
test.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');
test.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');
test.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');
test.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');
test.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');
test.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');
test.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');
test.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');
test.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');
test.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');
test.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');
test.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');
test.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');
test.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');
test.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');
test.done();
},
"format month" : function(test) {
test.expect(12);
moment.lang('eu');
var expected = 'urtarrila urt._otsaila ots._martxoa mar._apirila api._maiatza mai._ekaina eka._uztaila uzt._abuztua abu._iraila ira._urria urr._azaroa aza._abendua abe.'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);
}
test.done();
},
"format week" : function(test) {
test.expect(7);
moment.lang('eu');
var expected = 'igandea ig. ig_astelehena al. al_asteartea ar. ar_asteazkena az. az_osteguna og. og_ostirala ol. ol_larunbata lr. lr'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);
}
test.done();
},
"from" : function(test) {
test.expect(30);
moment.lang('eu');
var start = moment([2007, 1, 28]);
test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "segundo batzuk", "44 seconds = a few seconds");
test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "minutu bat", "45 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "minutu bat", "89 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutu", "90 seconds = 2 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutu", "44 minutes = 44 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "ordu bat", "45 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "ordu bat", "89 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 ordu", "90 minutes = 2 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 ordu", "5 hours = 5 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 ordu", "21 hours = 21 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "egun bat", "22 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "egun bat", "35 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 egun", "36 hours = 2 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "egun bat", "1 day = a day");
test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 egun", "5 days = 5 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 egun", "25 days = 25 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "hilabete bat", "26 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "hilabete bat", "30 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "hilabete bat", "45 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 hilabete", "46 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 hilabete", "75 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 hilabete", "76 days = 3 months");
test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "hilabete bat", "1 month = a month");
test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 hilabete", "5 months = 5 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 hilabete", "344 days = 11 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "urte bat", "345 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "urte bat", "547 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 urte", "548 days = 2 years");
test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "urte bat", "1 year = a year");
test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 urte", "5 years = 5 years");
test.done();
},
"suffix" : function(test) {
test.expect(2);
moment.lang('eu');
test.equal(moment(30000).from(0), "segundo batzuk barru", "prefix");
test.equal(moment(0).from(30000), "duela segundo batzuk", "suffix");
test.done();
},
"now from now" : function(test) {
test.expect(1);
moment.lang('eu');
test.equal(moment().fromNow(), "duela segundo batzuk", "now from now should display as in the past");
test.done();
},
"fromNow" : function(test) {
test.expect(2);
moment.lang('eu');
test.equal(moment().add({s:30}).fromNow(), "segundo batzuk barru", "in seconds");
test.equal(moment().add({d:5}).fromNow(), "5 egun barru", "in 5 days");
test.done();
},
"calendar day" : function(test) {
test.expect(6);
moment.lang('eu');
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "gaur 02:00etan", "today at the same time");
test.equal(moment(a).add({ m: 25 }).calendar(), "gaur 02:25etan", "now plus 25 min");
test.equal(moment(a).add({ h: 1 }).calendar(), "gaur 03:00etan", "now plus 1 hour");
test.equal(moment(a).add({ d: 1 }).calendar(), "bihar 02:00etan", "tomorrow at the same time");
test.equal(moment(a).subtract({ h: 1 }).calendar(), "gaur 01:00etan", "now minus 1 hour");
test.equal(moment(a).subtract({ d: 1 }).calendar(), "atzo 02:00etan", "yesterday at the same time");
test.done();
},
"calendar next week" : function(test) {
test.expect(15);
moment.lang('eu');
var i;
var m;
for (i = 2; i < 7; i++) {
m = moment().add({ d: i });
test.equal(m.calendar(), m.format('dddd LT[etan]'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd LT[etan]'), "Today + " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('dddd LT[etan]'), "Today + " + i + " days end of day");
}
test.done();
},
"calendar last week" : function(test) {
test.expect(15);
moment.lang('eu');
for (i = 2; i < 7; i++) {
m = moment().subtract({ d: i });
test.equal(m.calendar(), m.format('[aurreko] dddd LT[etan]'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[aurreko] dddd LT[etan]'), "Today - " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('[aurreko] dddd LT[etan]'), "Today - " + i + " days end of day");
}
test.done();
},
"calendar all else" : function(test) {
test.expect(4);
moment.lang('eu');
var weeksAgo = moment().subtract({ w: 1 });
var weeksFromNow = moment().add({ w: 1 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
weeksAgo = moment().subtract({ w: 2 });
weeksFromNow = moment().add({ w: 2 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
test.done();
}
};

View File

@ -0,0 +1,248 @@
var moment = require("../../moment");
/**************************************************
Finnish
*************************************************/
exports["lang:fi"] = {
"parse" : function(test) {
test.expect(96);
moment.lang('fi');
var tests = 'tammikuu tam_helmikuu hel_maaliskuu maa_huhtikuu huh_toukokuu tou_kesäkuu kes_heinäkuu hei_elokuu elo_syyskuu syys_lokakuu lok_marraskuu mar_joulukuu jou'.split("_");
var i;
function equalTest(input, mmm, i) {
test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
}
for (i = 0; i < 12; i++) {
tests[i] = tests[i].split(' ');
equalTest(tests[i][0], 'MMM', i);
equalTest(tests[i][1], 'MMM', i);
equalTest(tests[i][0], 'MMMM', i);
equalTest(tests[i][1], 'MMMM', i);
equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
}
test.done();
},
"format" : function(test) {
test.expect(18);
moment.lang('fi');
var a = [
['dddd, MMMM Do YYYY, h:mm:ss a', 'sunnuntai, helmikuu 14. 2010, 3:25:50 pm'],
['ddd, hA', 'su, 3PM'],
['M Mo MM MMMM MMM', '2 2. 02 helmikuu hel'],
['YYYY YY', '2010 10'],
['D Do DD', '14 14. 14'],
['d do dddd ddd dd', '0 0. sunnuntai su su'],
['DDD DDDo DDDD', '45 45. 045'],
['w wo ww', '8 8. 08'],
['h hh', '3 03'],
['H HH', '15 15'],
['m mm', '25 25'],
['s ss', '50 50'],
['a A', 'pm PM'],
['vuo\\den DDDo päivä', 'vuoden 45. päivä'],
['L', '14.02.2010'],
['LL', '14. helmikuuta 2010'],
['LLL', '14. helmikuuta 2010, klo 15.25'],
['LLLL', 'sunnuntai, 14. helmikuuta 2010, klo 15.25']
],
b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
i;
for (i = 0; i < a.length; i++) {
test.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
}
test.done();
},
"format ordinal" : function(test) {
test.expect(31);
moment.lang('fi');
test.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1st');
test.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2nd');
test.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3rd');
test.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4th');
test.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5th');
test.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6th');
test.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7th');
test.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8th');
test.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9th');
test.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10th');
test.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11th');
test.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12th');
test.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13th');
test.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14th');
test.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15th');
test.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16th');
test.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17th');
test.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18th');
test.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19th');
test.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20th');
test.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21st');
test.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22nd');
test.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23rd');
test.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24th');
test.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25th');
test.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26th');
test.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27th');
test.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28th');
test.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29th');
test.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30th');
test.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31st');
test.done();
},
"format month" : function(test) {
test.expect(12);
moment.lang('fi');
var expected = 'tammikuu tam_helmikuu hel_maaliskuu maa_huhtikuu huh_toukokuu tou_kesäkuu kes_heinäkuu hei_elokuu elo_syyskuu syy_lokakuu lok_marraskuu mar_joulukuu jou'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);
}
test.done();
},
"format week" : function(test) {
test.expect(7);
moment.lang('fi');
var expected = 'sunnuntai su su_maanantai ma ma_tiistai ti ti_keskiviikko ke ke_torstai to to_perjantai pe pe_lauantai la la'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);
}
test.done();
},
"from" : function(test) {
test.expect(30);
moment.lang('fi');
var start = moment([2007, 1, 28]);
test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "muutama sekunti", "44 seconds = few seconds");
test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "minuutti", "45 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "minuutti", "89 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "kaksi minuuttia", "90 seconds = 2 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minuuttia", "44 minutes = 44 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "tunti", "45 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "tunti", "89 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "kaksi tuntia", "90 minutes = 2 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "viisi tuntia", "5 hours = 5 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 tuntia", "21 hours = 21 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "päivä", "22 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "päivä", "35 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "kaksi päivää", "36 hours = 2 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "päivä", "1 day = a day");
test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "viisi päivää", "5 days = 5 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 päivää", "25 days = 25 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "kuukausi", "26 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "kuukausi", "30 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "kuukausi", "45 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "kaksi kuukautta", "46 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "kaksi kuukautta", "75 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "kolme kuukautta", "76 days = 3 months");
test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "kuukausi", "1 month = a month");
test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "viisi kuukautta", "5 months = 5 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 kuukautta", "344 days = 11 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "vuosi", "345 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "vuosi", "547 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "kaksi vuotta", "548 days = 2 years");
test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "vuosi", "1 year = a year");
test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "viisi vuotta", "5 years = 5 years");
test.done();
},
"suffix" : function(test) {
test.expect(2);
moment.lang('fi');
test.equal(moment(30000).from(0), "muutaman sekunnin päästä", "prefix");
test.equal(moment(0).from(30000), "muutama sekunti sitten", "suffix");
test.done();
},
"now from now" : function(test) {
test.expect(1);
moment.lang('fi');
test.equal(moment().fromNow(), "muutama sekunti sitten", "now from now should display as in the past");
test.done();
},
"fromNow" : function(test) {
test.expect(2);
moment.lang('fi');
test.equal(moment().add({s:30}).fromNow(), "muutaman sekunnin päästä", "in a few seconds");
test.equal(moment().add({d:5}).fromNow(), "viiden päivän päästä", "in 5 days");
test.done();
},
"calendar day" : function(test) {
test.expect(6);
moment.lang('fi');
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "tänään klo 02.00", "today at the same time");
test.equal(moment(a).add({ m: 25 }).calendar(), "tänään klo 02.25", "Now plus 25 min");
test.equal(moment(a).add({ h: 1 }).calendar(), "tänään klo 03.00", "Now plus 1 hour");
test.equal(moment(a).add({ d: 1 }).calendar(), "huomenna klo 02.00", "tomorrow at the same time");
test.equal(moment(a).subtract({ h: 1 }).calendar(), "tänään klo 01.00", "Now minus 1 hour");
test.equal(moment(a).subtract({ d: 1 }).calendar(), "eilen klo 02.00", "yesterday at the same time");
test.done();
},
"calendar next week" : function(test) {
test.expect(15);
moment.lang('fi');
var i;
var m;
for (i = 2; i < 7; i++) {
m = moment().add({ d: i });
test.equal(m.calendar(), m.format('dddd [klo] LT'), "today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [klo] LT'), "today + " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('dddd [klo] LT'), "today + " + i + " days end of day");
}
test.done();
},
"calendar last week" : function(test) {
test.expect(15);
moment.lang('fi');
for (var i = 2; i < 7; i++) {
var m = moment().subtract({ d: i });
test.equal(m.calendar(), m.format('[viime] dddd[na] [klo] LT'), "today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[viime] dddd[na] [klo] LT'), "today - " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('[viime] dddd[na] [klo] LT'), "today - " + i + " days end of day");
}
test.done();
},
"calendar all else" : function(test) {
test.expect(4);
moment.lang('fi');
var weeksAgo = moment().subtract({ w: 1 });
var weeksFromNow = moment().add({ w: 1 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "yksi viikko sitten");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "yhden viikon päästä");
weeksAgo = moment().subtract({ w: 2 });
weeksFromNow = moment().add({ w: 2 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "kaksi viikkoa sitten");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "kaden viikon päästä");
test.done();
}
};

View File

@ -0,0 +1,241 @@
var moment = require("../../moment");
/**************************************************
French
*************************************************/
exports["lang:fr-ca"] = {
"parse" : function(test) {
test.expect(96);
moment.lang('fr-ca');
var tests = 'janvier janv._février févr._mars mars_avril avr._mai mai_juin juin_juillet juil._août août_septembre sept._octobre oct._novembre nov._décembre déc.'.split("_");
var i;
function equalTest(input, mmm, i) {
test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
}
for (i = 0; i < 12; i++) {
tests[i] = tests[i].split(' ');
equalTest(tests[i][0], 'MMM', i);
equalTest(tests[i][1], 'MMM', i);
equalTest(tests[i][0], 'MMMM', i);
equalTest(tests[i][1], 'MMMM', i);
equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
}
test.done();
},
"format" : function(test) {
test.expect(18);
moment.lang('fr-ca');
var a = [
['dddd, MMMM Do YYYY, h:mm:ss a', 'dimanche, février 14ème 2010, 3:25:50 pm'],
['ddd, hA', 'dim., 3PM'],
['M Mo MM MMMM MMM', '2 2ème 02 février févr.'],
['YYYY YY', '2010 10'],
['D Do DD', '14 14ème 14'],
['d do dddd ddd dd', '0 0ème dimanche dim. Di'],
['DDD DDDo DDDD', '45 45ème 045'],
['w wo ww', '8 8ème 08'],
['h hh', '3 03'],
['H HH', '15 15'],
['m mm', '25 25'],
['s ss', '50 50'],
['a A', 'pm PM'],
['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45ème day of the year'],
['L', '2010-02-14'],
['LL', '14 février 2010'],
['LLL', '14 février 2010 15:25'],
['LLLL', 'dimanche 14 février 2010 15:25']
],
b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
i;
for (i = 0; i < a.length; i++) {
test.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
}
test.done();
},
"format ordinal" : function(test) {
test.expect(31);
moment.lang('fr');
test.equal(moment([2011, 0, 1]).format('DDDo'), '1er', '1er');
test.equal(moment([2011, 0, 2]).format('DDDo'), '2ème', '2ème');
test.equal(moment([2011, 0, 3]).format('DDDo'), '3ème', '3ème');
test.equal(moment([2011, 0, 4]).format('DDDo'), '4ème', '4ème');
test.equal(moment([2011, 0, 5]).format('DDDo'), '5ème', '5ème');
test.equal(moment([2011, 0, 6]).format('DDDo'), '6ème', '6ème');
test.equal(moment([2011, 0, 7]).format('DDDo'), '7ème', '7ème');
test.equal(moment([2011, 0, 8]).format('DDDo'), '8ème', '8ème');
test.equal(moment([2011, 0, 9]).format('DDDo'), '9ème', '9ème');
test.equal(moment([2011, 0, 10]).format('DDDo'), '10ème', '10ème');
test.equal(moment([2011, 0, 11]).format('DDDo'), '11ème', '11ème');
test.equal(moment([2011, 0, 12]).format('DDDo'), '12ème', '12ème');
test.equal(moment([2011, 0, 13]).format('DDDo'), '13ème', '13ème');
test.equal(moment([2011, 0, 14]).format('DDDo'), '14ème', '14ème');
test.equal(moment([2011, 0, 15]).format('DDDo'), '15ème', '15ème');
test.equal(moment([2011, 0, 16]).format('DDDo'), '16ème', '16ème');
test.equal(moment([2011, 0, 17]).format('DDDo'), '17ème', '17ème');
test.equal(moment([2011, 0, 18]).format('DDDo'), '18ème', '18ème');
test.equal(moment([2011, 0, 19]).format('DDDo'), '19ème', '19ème');
test.equal(moment([2011, 0, 20]).format('DDDo'), '20ème', '20ème');
test.equal(moment([2011, 0, 21]).format('DDDo'), '21ème', '21ème');
test.equal(moment([2011, 0, 22]).format('DDDo'), '22ème', '22ème');
test.equal(moment([2011, 0, 23]).format('DDDo'), '23ème', '23ème');
test.equal(moment([2011, 0, 24]).format('DDDo'), '24ème', '24ème');
test.equal(moment([2011, 0, 25]).format('DDDo'), '25ème', '25ème');
test.equal(moment([2011, 0, 26]).format('DDDo'), '26ème', '26ème');
test.equal(moment([2011, 0, 27]).format('DDDo'), '27ème', '27ème');
test.equal(moment([2011, 0, 28]).format('DDDo'), '28ème', '28ème');
test.equal(moment([2011, 0, 29]).format('DDDo'), '29ème', '29ème');
test.equal(moment([2011, 0, 30]).format('DDDo'), '30ème', '30ème');
test.equal(moment([2011, 0, 31]).format('DDDo'), '31ème', '31ème');
test.done();
},
"format month" : function(test) {
test.expect(12);
moment.lang('fr');
var expected = 'janvier janv._février févr._mars mars_avril avr._mai mai_juin juin_juillet juil._août août_septembre sept._octobre oct._novembre nov._décembre déc.'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);
}
test.done();
},
"format week" : function(test) {
test.expect(7);
moment.lang('fr');
var expected = 'dimanche dim. Di_lundi lun. Lu_mardi mar. Ma_mercredi mer. Me_jeudi jeu. Je_vendredi ven. Ve_samedi sam. Sa'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);
}
test.done();
},
"from" : function(test) {
test.expect(30);
moment.lang('fr');
var start = moment([2007, 1, 28]);
test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "quelques secondes", "44 seconds = a few seconds");
test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "une minute", "45 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "une minute", "89 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutes", "90 seconds = 2 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutes", "44 minutes = 44 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "une heure", "45 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "une heure", "89 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 heures", "90 minutes = 2 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 heures", "5 hours = 5 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 heures", "21 hours = 21 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "un jour", "22 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "un jour", "35 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 jours", "36 hours = 2 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "un jour", "1 day = a day");
test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 jours", "5 days = 5 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 jours", "25 days = 25 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "un mois", "26 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "un mois", "30 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "un mois", "45 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 mois", "46 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 mois", "75 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 mois", "76 days = 3 months");
test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "un mois", "1 month = a month");
test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 mois", "5 months = 5 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 mois", "344 days = 11 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "une année", "345 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "une année", "547 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 années", "548 days = 2 years");
test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "une année", "1 year = a year");
test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 années", "5 years = 5 years");
test.done();
},
"suffix" : function(test) {
test.expect(2);
moment.lang('fr');
test.equal(moment(30000).from(0), "dans quelques secondes", "prefix");
test.equal(moment(0).from(30000), "il y a quelques secondes", "suffix");
test.done();
},
"fromNow" : function(test) {
test.expect(2);
moment.lang('fr');
test.equal(moment().add({s:30}).fromNow(), "dans quelques secondes", "in a few seconds");
test.equal(moment().add({d:5}).fromNow(), "dans 5 jours", "in 5 days");
test.done();
},
"same day" : function(test) {
test.expect(6);
moment.lang('fr');
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Aujourd'hui à 02:00", "today at the same time");
test.equal(moment(a).add({ m: 25 }).calendar(), "Aujourd'hui à 02:25", "Now plus 25 min");
test.equal(moment(a).add({ h: 1 }).calendar(), "Aujourd'hui à 03:00", "Now plus 1 hour");
test.equal(moment(a).add({ d: 1 }).calendar(), "Demain à 02:00", "tomorrow at the same time");
test.equal(moment(a).subtract({ h: 1 }).calendar(), "Aujourd'hui à 01:00", "Now minus 1 hour");
test.equal(moment(a).subtract({ d: 1 }).calendar(), "Hier à 02:00", "yesterday at the same time");
test.done();
},
"same next week" : function(test) {
test.expect(15);
moment.lang('fr');
var i;
var m;
for (i = 2; i < 7; i++) {
m = moment().add({ d: i });
test.equal(m.calendar(), m.format('dddd [à] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [à] LT'), "Today + " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('dddd [à] LT'), "Today + " + i + " days end of day");
}
test.done();
},
"same last week" : function(test) {
test.expect(15);
moment.lang('fr');
for (i = 2; i < 7; i++) {
m = moment().subtract({ d: i });
test.equal(m.calendar(), m.format('dddd [dernier à] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [dernier à] LT'), "Today - " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('dddd [dernier à] LT'), "Today - " + i + " days end of day");
}
test.done();
},
"same all else" : function(test) {
test.expect(4);
moment.lang('fr');
var weeksAgo = moment().subtract({ w: 1 });
var weeksFromNow = moment().add({ w: 1 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
weeksAgo = moment().subtract({ w: 2 });
weeksFromNow = moment().add({ w: 2 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
test.done();
}
};

View File

@ -0,0 +1,241 @@
var moment = require("../../moment");
/**************************************************
French
*************************************************/
exports["lang:fr"] = {
"parse" : function(test) {
test.expect(96);
moment.lang('fr');
var tests = 'janvier janv._février févr._mars mars_avril avr._mai mai_juin juin_juillet juil._août août_septembre sept._octobre oct._novembre nov._décembre déc.'.split("_");
var i;
function equalTest(input, mmm, i) {
test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
}
for (i = 0; i < 12; i++) {
tests[i] = tests[i].split(' ');
equalTest(tests[i][0], 'MMM', i);
equalTest(tests[i][1], 'MMM', i);
equalTest(tests[i][0], 'MMMM', i);
equalTest(tests[i][1], 'MMMM', i);
equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
}
test.done();
},
"format" : function(test) {
test.expect(18);
moment.lang('fr');
var a = [
['dddd, MMMM Do YYYY, h:mm:ss a', 'dimanche, février 14ème 2010, 3:25:50 pm'],
['ddd, hA', 'dim., 3PM'],
['M Mo MM MMMM MMM', '2 2ème 02 février févr.'],
['YYYY YY', '2010 10'],
['D Do DD', '14 14ème 14'],
['d do dddd ddd dd', '0 0ème dimanche dim. Di'],
['DDD DDDo DDDD', '45 45ème 045'],
['w wo ww', '8 8ème 08'],
['h hh', '3 03'],
['H HH', '15 15'],
['m mm', '25 25'],
['s ss', '50 50'],
['a A', 'pm PM'],
['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45ème day of the year'],
['L', '14/02/2010'],
['LL', '14 février 2010'],
['LLL', '14 février 2010 15:25'],
['LLLL', 'dimanche 14 février 2010 15:25']
],
b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
i;
for (i = 0; i < a.length; i++) {
test.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
}
test.done();
},
"format ordinal" : function(test) {
test.expect(31);
moment.lang('fr');
test.equal(moment([2011, 0, 1]).format('DDDo'), '1er', '1er');
test.equal(moment([2011, 0, 2]).format('DDDo'), '2ème', '2ème');
test.equal(moment([2011, 0, 3]).format('DDDo'), '3ème', '3ème');
test.equal(moment([2011, 0, 4]).format('DDDo'), '4ème', '4ème');
test.equal(moment([2011, 0, 5]).format('DDDo'), '5ème', '5ème');
test.equal(moment([2011, 0, 6]).format('DDDo'), '6ème', '6ème');
test.equal(moment([2011, 0, 7]).format('DDDo'), '7ème', '7ème');
test.equal(moment([2011, 0, 8]).format('DDDo'), '8ème', '8ème');
test.equal(moment([2011, 0, 9]).format('DDDo'), '9ème', '9ème');
test.equal(moment([2011, 0, 10]).format('DDDo'), '10ème', '10ème');
test.equal(moment([2011, 0, 11]).format('DDDo'), '11ème', '11ème');
test.equal(moment([2011, 0, 12]).format('DDDo'), '12ème', '12ème');
test.equal(moment([2011, 0, 13]).format('DDDo'), '13ème', '13ème');
test.equal(moment([2011, 0, 14]).format('DDDo'), '14ème', '14ème');
test.equal(moment([2011, 0, 15]).format('DDDo'), '15ème', '15ème');
test.equal(moment([2011, 0, 16]).format('DDDo'), '16ème', '16ème');
test.equal(moment([2011, 0, 17]).format('DDDo'), '17ème', '17ème');
test.equal(moment([2011, 0, 18]).format('DDDo'), '18ème', '18ème');
test.equal(moment([2011, 0, 19]).format('DDDo'), '19ème', '19ème');
test.equal(moment([2011, 0, 20]).format('DDDo'), '20ème', '20ème');
test.equal(moment([2011, 0, 21]).format('DDDo'), '21ème', '21ème');
test.equal(moment([2011, 0, 22]).format('DDDo'), '22ème', '22ème');
test.equal(moment([2011, 0, 23]).format('DDDo'), '23ème', '23ème');
test.equal(moment([2011, 0, 24]).format('DDDo'), '24ème', '24ème');
test.equal(moment([2011, 0, 25]).format('DDDo'), '25ème', '25ème');
test.equal(moment([2011, 0, 26]).format('DDDo'), '26ème', '26ème');
test.equal(moment([2011, 0, 27]).format('DDDo'), '27ème', '27ème');
test.equal(moment([2011, 0, 28]).format('DDDo'), '28ème', '28ème');
test.equal(moment([2011, 0, 29]).format('DDDo'), '29ème', '29ème');
test.equal(moment([2011, 0, 30]).format('DDDo'), '30ème', '30ème');
test.equal(moment([2011, 0, 31]).format('DDDo'), '31ème', '31ème');
test.done();
},
"format month" : function(test) {
test.expect(12);
moment.lang('fr');
var expected = 'janvier janv._février févr._mars mars_avril avr._mai mai_juin juin_juillet juil._août août_septembre sept._octobre oct._novembre nov._décembre déc.'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);
}
test.done();
},
"format week" : function(test) {
test.expect(7);
moment.lang('fr');
var expected = 'dimanche dim. Di_lundi lun. Lu_mardi mar. Ma_mercredi mer. Me_jeudi jeu. Je_vendredi ven. Ve_samedi sam. Sa'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);
}
test.done();
},
"from" : function(test) {
test.expect(30);
moment.lang('fr');
var start = moment([2007, 1, 28]);
test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "quelques secondes", "44 seconds = a few seconds");
test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "une minute", "45 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "une minute", "89 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutes", "90 seconds = 2 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutes", "44 minutes = 44 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "une heure", "45 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "une heure", "89 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 heures", "90 minutes = 2 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 heures", "5 hours = 5 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 heures", "21 hours = 21 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "un jour", "22 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "un jour", "35 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 jours", "36 hours = 2 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "un jour", "1 day = a day");
test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 jours", "5 days = 5 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 jours", "25 days = 25 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "un mois", "26 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "un mois", "30 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "un mois", "45 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 mois", "46 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 mois", "75 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 mois", "76 days = 3 months");
test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "un mois", "1 month = a month");
test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 mois", "5 months = 5 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 mois", "344 days = 11 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "une année", "345 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "une année", "547 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 années", "548 days = 2 years");
test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "une année", "1 year = a year");
test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 années", "5 years = 5 years");
test.done();
},
"suffix" : function(test) {
test.expect(2);
moment.lang('fr');
test.equal(moment(30000).from(0), "dans quelques secondes", "prefix");
test.equal(moment(0).from(30000), "il y a quelques secondes", "suffix");
test.done();
},
"fromNow" : function(test) {
test.expect(2);
moment.lang('fr');
test.equal(moment().add({s:30}).fromNow(), "dans quelques secondes", "in a few seconds");
test.equal(moment().add({d:5}).fromNow(), "dans 5 jours", "in 5 days");
test.done();
},
"same day" : function(test) {
test.expect(6);
moment.lang('fr');
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Aujourd'hui à 02:00", "today at the same time");
test.equal(moment(a).add({ m: 25 }).calendar(), "Aujourd'hui à 02:25", "Now plus 25 min");
test.equal(moment(a).add({ h: 1 }).calendar(), "Aujourd'hui à 03:00", "Now plus 1 hour");
test.equal(moment(a).add({ d: 1 }).calendar(), "Demain à 02:00", "tomorrow at the same time");
test.equal(moment(a).subtract({ h: 1 }).calendar(), "Aujourd'hui à 01:00", "Now minus 1 hour");
test.equal(moment(a).subtract({ d: 1 }).calendar(), "Hier à 02:00", "yesterday at the same time");
test.done();
},
"same next week" : function(test) {
test.expect(15);
moment.lang('fr');
var i;
var m;
for (i = 2; i < 7; i++) {
m = moment().add({ d: i });
test.equal(m.calendar(), m.format('dddd [à] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [à] LT'), "Today + " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('dddd [à] LT'), "Today + " + i + " days end of day");
}
test.done();
},
"same last week" : function(test) {
test.expect(15);
moment.lang('fr');
for (i = 2; i < 7; i++) {
m = moment().subtract({ d: i });
test.equal(m.calendar(), m.format('dddd [dernier à] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [dernier à] LT'), "Today - " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('dddd [dernier à] LT'), "Today - " + i + " days end of day");
}
test.done();
},
"same all else" : function(test) {
test.expect(4);
moment.lang('fr');
var weeksAgo = moment().subtract({ w: 1 });
var weeksFromNow = moment().add({ w: 1 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
weeksAgo = moment().subtract({ w: 2 });
weeksFromNow = moment().add({ w: 2 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
test.done();
}
};

View File

@ -0,0 +1,232 @@
var moment = require("../../moment");
/**************************************************
Galego
*************************************************/
exports["lang:gl"] = {
"parse" : function(test) {
test.expect(96);
moment.lang('gl');
var tests = "Xaneiro Xan._Febreiro Feb._Marzo Mar._Abril Abr._Maio Mai._Xuño Xuñ._Xullo Xul._Agosto Ago._Setembro Set._Octubro Out._Novembro Nov._Decembro Dec.".split("_");
var i;
function equalTest(input, mmm, i) {
test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
}
for (i = 0; i < 12; i++) {
tests[i] = tests[i].split(' ');
equalTest(tests[i][0], 'MMM', i);
equalTest(tests[i][1], 'MMM', i);
equalTest(tests[i][0], 'MMMM', i);
equalTest(tests[i][1], 'MMMM', i);
equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
}
test.done();
},
"format ordinal" : function(test) {
test.expect(31);
moment.lang('es');
test.equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
test.equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º');
test.equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º');
test.equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º');
test.equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º');
test.equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º');
test.equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º');
test.equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º');
test.equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º');
test.equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º');
test.equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º');
test.equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º');
test.equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º');
test.equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º');
test.equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º');
test.equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º');
test.equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º');
test.equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º');
test.equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º');
test.equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º');
test.equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º');
test.equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º');
test.equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º');
test.equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º');
test.equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º');
test.equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º');
test.equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º');
test.equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º');
test.equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º');
test.equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º');
test.equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º');
test.done();
},
"format month" : function(test) {
test.expect(12);
moment.lang('gl');
var expected = "Xaneiro Xan._Febreiro Feb._Marzo Mar._Abril Abr._Maio Mai._Xuño Xuñ._Xullo Xul._Agosto Ago._Setembro Set._Octubro Out._Novembro Nov._Decembro Dec.".split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);
}
test.done();
},
"format week" : function(test) {
test.expect(7);
moment.lang('gl');
var expected = "Domingo Dom. Do_Luns Lun. Lu_Martes Mar. Ma_Mércores Mér. Mé_Xoves Xov. Xo_Venres Ven. Ve_Sábado Sáb. Sá".split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);
}
test.done();
},
"from" : function(test) {
test.expect(30);
moment.lang('gl');
var start = moment([2007, 1, 28]);
test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "uns segundo", "44 seconds = a few seconds");
test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "un minuto", "45 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "un minuto", "89 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutos", "90 seconds = 2 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutos", "44 minutes = 44 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "unha hora", "45 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "unha hora", "89 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 horas", "90 minutes = 2 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 horas", "5 hours = 5 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 horas", "21 hours = 21 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "un día", "22 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "un día", "35 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 días", "36 hours = 2 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "un día", "1 day = a day");
test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 días", "5 days = 5 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 días", "25 days = 25 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "un mes", "26 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "un mes", "30 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "un mes", "45 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 meses", "46 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 meses", "75 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 meses", "76 days = 3 months");
test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "un mes", "1 month = a month");
test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 meses", "5 months = 5 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 meses", "344 days = 11 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "un ano", "345 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "un ano", "547 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 anos", "548 days = 2 years");
test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "un ano", "1 year = a year");
test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 anos", "5 years = 5 years");
test.done();
},
"suffix" : function(test) {
test.expect(2);
moment.lang('gl');
test.equal(moment(30000).from(0), "en uns segundo", "prefix");
test.equal(moment(0).from(30000), "fai uns segundo", "suffix");
test.done();
},
"now from now" : function(test) {
test.expect(1);
moment.lang('gl');
test.equal(moment().fromNow(), "fai uns segundo", "now from now should display as in the past");
test.done();
},
"fromNow" : function(test) {
test.expect(2);
moment.lang('gl');
test.equal(moment().add({s:30}).fromNow(), "en uns segundo", "en unos segundos");
test.equal(moment().add({d:5}).fromNow(), "en 5 días", "en 5 días");
test.done();
},
"calendar day" : function(test) {
test.expect(7);
moment.lang('gl');
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "hoxe ás 2:00", "today at the same time");
test.equal(moment(a).add({ m: 25 }).calendar(), "hoxe ás 2:25", "Now plus 25 min");
test.equal(moment(a).add({ h: 1 }).calendar(), "hoxe ás 3:00", "Now plus 1 hour");
test.equal(moment(a).add({ d: 1 }).calendar(), "mañá ás 2:00", "tomorrow at the same time");
test.equal(moment(a).add({ d: 1, h : -1 }).calendar(), "mañá a 1:00", "tomorrow minus 1 hour");
test.equal(moment(a).subtract({ h: 1 }).calendar(), "hoxe a 1:00", "Now minus 1 hour");
test.equal(moment(a).subtract({ d: 1 }).calendar(), "onte á 2:00", "yesterday at the same time");
test.done();
},
"calendar next week" : function(test) {
test.expect(15);
moment.lang('gl');
var i;
var m;
for (i = 2; i < 7; i++) {
m = moment().add({ d: i });
test.equal(m.calendar(), m.format('dddd [' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'), "Today + " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('dddd [' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'), "Today + " + i + " days end of day");
}
test.done();
},
"calendar last week" : function(test) {
test.expect(15);
moment.lang('gl');
for (i = 2; i < 7; i++) {
m = moment().subtract({ d: i });
test.equal(m.calendar(), m.format('[o] dddd [pasado ' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[o] dddd [pasado ' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'), "Today - " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('[o] dddd [pasado ' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'), "Today - " + i + " days end of day");
}
test.done();
},
"calendar all else" : function(test) {
test.expect(4);
moment.lang('gl');
var weeksAgo = moment().subtract({ w: 1 });
var weeksFromNow = moment().add({ w: 1 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
weeksAgo = moment().subtract({ w: 2 });
weeksFromNow = moment().add({ w: 2 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
test.done();
},
"regression tests" : function(test) {
test.expect(1);
moment.lang('gl');
var lastWeek = moment().subtract({ d: 4 }).hours(1);
test.equal(lastWeek.calendar(), lastWeek.format('[o] dddd [pasado a] LT'), "1 o'clock bug");
test.done();
}
};

View File

@ -0,0 +1,250 @@
var moment = require("../../moment");
/**************************************************
English
*************************************************/
exports["lang:hu"] = {
"parse" : function(test) {
test.expect(96);
moment.lang('hu');
var tests = 'január jan_február feb_március márc_április ápr_május máj_június jún_július júl_augusztus aug_szeptember szept_október okt_november nov_december dec'.split("_");
var i;
function equalTest(input, mmm, i) {
test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
}
for (i = 0; i < 12; i++) {
tests[i] = tests[i].split(' ');
equalTest(tests[i][0], 'MMM', i);
equalTest(tests[i][1], 'MMM', i);
equalTest(tests[i][0], 'MMMM', i);
equalTest(tests[i][1], 'MMMM', i);
equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
}
test.done();
},
"format" : function(test) {
test.expect(16);
moment.lang('hu');
var a = [
['dddd, MMMM Do YYYY, HH:mm:ss', 'vasárnap, február 14. 2010, 15:25:50'],
['ddd, HH', 'v, 15'],
['M Mo MM MMMM MMM', '2 2. 02 február feb'],
['YYYY YY', '2010 10'],
['D Do DD', '14 14. 14'],
['d do dddd ddd', '0 0. vasárnap v'],
['DDD DDDo DDDD', '45 45. 045'],
['w wo ww', '8 8. 08'],
['H HH', '15 15'],
['m mm', '25 25'],
['s ss', '50 50'],
['\\az év DDDo n\\apj\\a', 'az év 45. napja'],
['L', '2010.02.14.'],
['LL', '2010. február 14.'],
['LLL', '2010. február 14., 15:25'],
['LLLL', '2010. február 14., vasárnap 15:25']
],
b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
i;
for (i = 0; i < a.length; i++) {
test.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
}
test.done();
},
"format ordinal" : function(test) {
test.expect(31);
moment.lang('hu');
test.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
test.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
test.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
test.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');
test.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');
test.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');
test.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');
test.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');
test.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');
test.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');
test.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');
test.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');
test.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');
test.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');
test.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');
test.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');
test.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');
test.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');
test.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');
test.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');
test.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');
test.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');
test.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');
test.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');
test.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');
test.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');
test.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');
test.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');
test.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');
test.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');
test.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');
test.done();
},
"format month" : function(test) {
test.expect(12);
moment.lang('hu');
var expected = 'január jan_február feb_március márc_április ápr_május máj_június jún_július júl_augusztus aug_szeptember szept_október okt_november nov_december dec'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);
}
test.done();
},
"format week" : function(test) {
test.expect(7);
moment.lang('hu');
var expected = 'vasárnap v_hétfő h_kedd k_szerda sze_csütörtök cs_péntek p_szombat szo'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
}
test.done();
},
"from" : function(test) {
test.expect(30);
moment.lang('hu');
var start = moment([2007, 1, 28]);
test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "néhány másodperc", "44 másodperc = néhány másodperc");
test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "egy perc", "45 másodperc = egy perc");
test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "egy perc", "89 másodperc = egy perc");
test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 perc", "90 másodperc = 2 perc");
test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 perc", "44 perc = 44 perc");
test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "egy óra", "45 perc = egy óra");
test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "egy óra", "89 perc = egy óra");
test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 óra", "90 perc = 2 óra");
test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 óra", "5 óra = 5 óra");
test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 óra", "21 óra = 21 óra");
test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "egy nap", "22 óra = egy nap");
test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "egy nap", "35 óra = egy nap");
test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 nap", "36 óra = 2 nap");
test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "egy nap", "1 nap = egy nap");
test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 nap", "5 nap = 5 nap");
test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 nap", "25 nap = 25 nap");
test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "egy hónap", "26 nap = egy hónap");
test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "egy hónap", "30 nap = egy hónap");
test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "egy hónap", "45 nap = egy hónap");
test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 hónap", "46 nap = 2 hónap");
test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 hónap", "75 nap = 2 hónap");
test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 hónap", "76 nap = 3 hónap");
test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "egy hónap", "1 hónap = egy hónap");
test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 hónap", "5 hónap = 5 hónap");
test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 hónap", "344 nap = 11 hónap");
test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "egy év", "345 nap = egy év");
test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "egy év", "547 nap = egy év");
test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 év", "548 nap = 2 év");
test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "egy év", "1 év = egy év");
test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 év", "5 év = 5 év");
test.done();
},
"suffix" : function(test) {
test.expect(2);
moment.lang('hu');
test.equal(moment(30000).from(0), "néhány másodperc múlva", "prefix");
test.equal(moment(0).from(30000), "néhány másodperce", "suffix");
test.done();
},
"now from now" : function(test) {
test.expect(1);
moment.lang('hu');
test.equal(moment().fromNow(), "néhány másodperce", "now from now should display as in the past");
test.done();
},
"fromNow" : function(test) {
test.expect(2);
moment.lang('hu');
test.equal(moment().add({s:30}).fromNow(), "néhány másodperc múlva", "néhány másodperc múlva");
test.equal(moment().add({d:5}).fromNow(), "5 nap múlva", "5 nap múlva");
test.done();
},
"calendar day" : function(test) {
test.expect(6);
moment.lang('hu');
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "ma 2:00-kor", "today at the same time");
test.equal(moment(a).add({ m: 25 }).calendar(), "ma 2:25-kor", "Now plus 25 min");
test.equal(moment(a).add({ h: 1 }).calendar(), "ma 3:00-kor", "Now plus 1 hour");
test.equal(moment(a).add({ d: 1 }).calendar(), "holnap 2:00-kor", "tomorrow at the same time");
test.equal(moment(a).subtract({ h: 1 }).calendar(), "ma 1:00-kor", "Now minus 1 hour");
test.equal(moment(a).subtract({ d: 1 }).calendar(), "tegnap 2:00-kor", "yesterday at the same time");
test.done();
},
"calendar next week" : function(test) {
test.expect(15);
moment.lang('hu');
var i;
var m;
var days = 'vasárnap_hétfőn_kedden_szerdán_csütörtökön_pénteken_szombaton'.split('_');
for (i = 2; i < 7; i++) {
m = moment().add({ d: i });
test.equal(m.calendar(), m.format('['+days[m.day()]+'] LT[-kor]'), "today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('['+days[m.day()]+'] LT[-kor]'), "today + " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('['+days[m.day()]+'] LT[-kor]'), "today + " + i + " days end of day");
}
test.done();
},
"calendar last week" : function(test) {
test.expect(15);
moment.lang('hu');
var days = 'vasárnap_hétfőn_kedden_szerdán_csütörtökön_pénteken_szombaton'.split('_');
for (var i = 2; i < 7; i++) {
var m = moment().subtract({ d: i });
test.equal(m.calendar(), m.format('múlt ['+days[m.day()]+'] LT[-kor]'), "today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('múlt ['+days[m.day()]+'] LT[-kor]'), "today - " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('múlt ['+days[m.day()]+'] LT[-kor]'), "today - " + i + " days end of day");
}
test.done();
},
"calendar all else" : function(test) {
test.expect(4);
moment.lang('hu');
var weeksAgo = moment().subtract({ w: 1 });
var weeksFromNow = moment().add({ w: 1 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "egy héte");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "egy hét múlva");
weeksAgo = moment().subtract({ w: 2 });
weeksFromNow = moment().add({ w: 2 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 hete");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "2 hét múlva");
test.done();
}
};

View File

@ -0,0 +1,254 @@
var moment = require("../../moment");
/**************************************************
Icelandic
*************************************************/
exports["lang:is"] = {
"parse" : function(test) {
test.expect(96);
moment.lang('is');
var tests = 'janúar jan_febrúar feb_mars mar_apríl apr_maí maí_júní jún_júlí júl_ágúst ágú_september sep_október okt_nóvember nóv_desember des'.split("_");
var i;
function equalTest(input, mmm, i) {
test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
}
for (i = 0; i < 12; i++) {
tests[i] = tests[i].split(' ');
equalTest(tests[i][0], 'MMM', i);
equalTest(tests[i][1], 'MMM', i);
equalTest(tests[i][0], 'MMMM', i);
equalTest(tests[i][1], 'MMMM', i);
equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
}
test.done();
},
"format" : function(test) {
test.expect(18);
moment.lang('is');
var a = [
['dddd, Do MMMM YYYY, h:mm:ss a', 'sunnudagur, 14. febrúar 2010, 3:25:50 pm'],
['ddd, hA', 'sun, 3PM'],
['M Mo MM MMMM MMM', '2 2. 02 febrúar feb'],
['YYYY YY', '2010 10'],
['D Do DD', '14 14. 14'],
['d do dddd ddd dd', '0 0. sunnudagur sun Su'],
['DDD DDDo DDDD', '45 45. 045'],
['w wo ww', '8 8. 08'],
['h hh', '3 03'],
['H HH', '15 15'],
['m mm', '25 25'],
['s ss', '50 50'],
['a A', 'pm PM'],
['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45. day of the year'],
['L', '14/02/2010'],
['LL', '14. febrúar 2010'],
['LLL', '14. febrúar 2010 kl. 15:25'],
['LLLL', 'sunnudagur, 14. febrúar 2010 kl. 15:25']
],
b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
i;
for (i = 0; i < a.length; i++) {
test.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
}
test.done();
},
"format ordinal" : function(test) {
test.expect(31);
moment.lang('is');
test.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
test.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
test.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
test.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');
test.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');
test.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');
test.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');
test.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');
test.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');
test.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');
test.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');
test.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');
test.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');
test.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');
test.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');
test.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');
test.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');
test.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');
test.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');
test.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');
test.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');
test.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');
test.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');
test.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');
test.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');
test.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');
test.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');
test.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');
test.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');
test.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');
test.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');
test.done();
},
"format month" : function(test) {
test.expect(12);
moment.lang('is');
var expected = 'janúar jan_febrúar feb_mars mar_apríl apr_maí maí_júní jún_júlí júl_ágúst ágú_september sep_október okt_nóvember nóv_desember des'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);
}
test.done();
},
"format week" : function(test) {
test.expect(7);
moment.lang('is');
var expected = 'sunnudagur sun Su_mánudagur mán Má_þriðjudagur þri Þr_miðvikudagur mið Mi_fimmtudagur fim Fi_föstudagur fös Fö_laugardagur lau La'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);
}
test.done();
},
"from" : function(test) {
test.expect(34);
moment.lang('is');
var start = moment([2007, 1, 28]);
test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "nokkrar sekúndur", "44 seconds = a few seconds");
test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "mínúta", "45 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "mínúta", "89 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 mínútur", "90 seconds = 2 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 mínútur", "44 minutes = 44 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:21}), true), "21 mínúta", "21 minutes = 21 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "klukkustund", "45 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "klukkustund", "89 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 klukkustundir", "90 minutes = 2 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 klukkustundir", "5 hours = 5 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 klukkustund", "21 hours = 21 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "dagur", "22 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "dagur", "35 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dagar", "36 hours = 2 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "dagur", "1 day = a day");
test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dagar", "5 days = 5 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dagar", "25 days = 25 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:11}), true), "11 dagar", "11 days = 11 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:21}), true), "21 dagur", "21 days = 21 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "mánuður", "26 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "mánuður", "30 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "mánuður", "45 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 mánuðir", "46 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 mánuðir", "75 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 mánuðir", "76 days = 3 months");
test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "mánuður", "1 month = a month");
test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 mánuðir", "5 months = 5 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 mánuðir", "344 days = 11 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "ár", "345 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "ár", "547 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 ár", "548 days = 2 years");
test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "ár", "1 year = a year");
test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 ár", "5 years = 5 years");
test.equal(start.from(moment([2007, 1, 28]).add({y:21}), true), "21 ár", "21 years = 21 years");
test.done();
},
"suffix" : function(test) {
test.expect(3);
moment.lang('is');
test.equal(moment(30000).from(0), "eftir nokkrar sekúndur", "prefix");
test.equal(moment(0).from(30000), "fyrir nokkrum sekúndum síðan", "suffix");
test.equal(moment().subtract({m:1}).fromNow(), "fyrir mínútu síðan", "a minute ago");
test.done();
},
"now from now" : function(test) {
test.expect(1);
moment.lang('is');
test.equal(moment().fromNow(), "fyrir nokkrum sekúndum síðan", "now from now should display as in the past");
test.done();
},
"fromNow" : function(test) {
test.expect(3);
moment.lang('is');
test.equal(moment().add({s:30}).fromNow(), "eftir nokkrar sekúndur", "in a few seconds");
test.equal(moment().add({m:1}).fromNow(), "eftir mínútu", "in a minute");
test.equal(moment().add({d:5}).fromNow(), "eftir 5 daga", "in 5 days");
test.done();
},
"calendar day" : function(test) {
test.expect(6);
moment.lang('is');
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "í dag kl. 2:00", "today at the same time");
test.equal(moment(a).add({ m: 25 }).calendar(), "í dag kl. 2:25", "Now plus 25 min");
test.equal(moment(a).add({ h: 1 }).calendar(), "í dag kl. 3:00", "Now plus 1 hour");
test.equal(moment(a).add({ d: 1 }).calendar(), "á morgun kl. 2:00", "tomorrow at the same time");
test.equal(moment(a).subtract({ h: 1 }).calendar(), "í dag kl. 1:00", "Now minus 1 hour");
test.equal(moment(a).subtract({ d: 1 }).calendar(), "í gær kl. 2:00", "yesterday at the same time");
test.done();
},
"calendar next week" : function(test) {
test.expect(15);
moment.lang('is');
var i;
var m;
for (i = 2; i < 7; i++) {
m = moment().add({ d: i });
test.equal(m.calendar(), m.format('dddd [kl.] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [kl.] LT'), "Today + " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('dddd [kl.] LT'), "Today + " + i + " days end of day");
}
test.done();
},
"calendar last week" : function(test) {
test.expect(15);
moment.lang('is');
for (i = 2; i < 7; i++) {
m = moment().subtract({ d: i });
test.equal(m.calendar(), m.format('[síðasta] dddd [kl.] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[síðasta] dddd [kl.] LT'), "Today - " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('[síðasta] dddd [kl.] LT'), "Today - " + i + " days end of day");
}
test.done();
},
"calendar all else" : function(test) {
test.expect(4);
moment.lang('is');
var weeksAgo = moment().subtract({ w: 1 });
var weeksFromNow = moment().add({ w: 1 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
weeksAgo = moment().subtract({ w: 2 });
weeksFromNow = moment().add({ w: 2 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
test.done();
}
};

View File

@ -0,0 +1,241 @@
var moment = require("../../moment");
/**************************************************
Italian
*************************************************/
exports["lang:it"] = {
"parse" : function(test) {
test.expect(96);
moment.lang('it');
var tests = 'Gennaio Gen_Febbraio Feb_Marzo Mar_Aprile Apr_Maggio Mag_Giugno Giu_Luglio Lug_Agosto Ago_Settebre Set_Ottobre Ott_Novembre Nov_Dicembre Dic'.split("_");
var i;
function equalTest(input, mmm, i) {
test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
}
for (i = 0; i < 12; i++) {
tests[i] = tests[i].split(' ');
equalTest(tests[i][0], 'MMM', i);
equalTest(tests[i][1], 'MMM', i);
equalTest(tests[i][0], 'MMMM', i);
equalTest(tests[i][1], 'MMMM', i);
equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
}
test.done();
},
"format" : function(test) {
test.expect(18);
moment.lang('it');
var a = [
['dddd, MMMM Do YYYY, h:mm:ss a', 'Domenica, Febbraio 14º 2010, 3:25:50 pm'],
['ddd, hA', 'Dom, 3PM'],
['M Mo MM MMMM MMM', '2 2º 02 Febbraio Feb'],
['YYYY YY', '2010 10'],
['D Do DD', '14 14º 14'],
['d do dddd ddd dd', '0 0º Domenica Dom D'],
['DDD DDDo DDDD', '45 45º 045'],
['w wo ww', '8 8º 08'],
['h hh', '3 03'],
['H HH', '15 15'],
['m mm', '25 25'],
['s ss', '50 50'],
['a A', 'pm PM'],
['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45º day of the year'],
['L', '14/02/2010'],
['LL', '14 Febbraio 2010'],
['LLL', '14 Febbraio 2010 15:25'],
['LLLL', 'Domenica, 14 Febbraio 2010 15:25']
],
b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
i;
for (i = 0; i < a.length; i++) {
test.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
}
test.done();
},
"format ordinal" : function(test) {
test.expect(31);
moment.lang('it');
test.equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
test.equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º');
test.equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º');
test.equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º');
test.equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º');
test.equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º');
test.equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º');
test.equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º');
test.equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º');
test.equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º');
test.equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º');
test.equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º');
test.equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º');
test.equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º');
test.equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º');
test.equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º');
test.equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º');
test.equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º');
test.equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º');
test.equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º');
test.equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º');
test.equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º');
test.equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º');
test.equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º');
test.equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º');
test.equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º');
test.equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º');
test.equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º');
test.equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º');
test.equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º');
test.equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º');
test.done();
},
"format month" : function(test) {
test.expect(12);
moment.lang('it');
var expected = 'Gennaio Gen_Febbraio Feb_Marzo Mar_Aprile Apr_Maggio Mag_Giugno Giu_Luglio Lug_Agosto Ago_Settebre Set_Ottobre Ott_Novembre Nov_Dicembre Dic'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);
}
test.done();
},
"format week" : function(test) {
test.expect(7);
moment.lang('it');
var expected = 'Domenica Dom D_Lunedì Lun L_Martedì Mar Ma_Mercoledì Mer Me_Giovedì Gio G_Venerdì Ven V_Sabato Sab S'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);
}
test.done();
},
"from" : function(test) {
test.expect(30);
moment.lang('it');
var start = moment([2007, 1, 28]);
test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "secondi", "44 seconds = seconds");
test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "un minuto", "45 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "un minuto", "89 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minuti", "90 seconds = 2 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minuti", "44 minutes = 44 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "un'ora", "45 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "un'ora", "89 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 ore", "90 minutes = 2 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 ore", "5 hours = 5 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 ore", "21 hours = 21 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "un giorno", "22 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "un giorno", "35 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 giorni", "36 hours = 2 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "un giorno", "1 day = a day");
test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 giorni", "5 days = 5 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 giorni", "25 days = 25 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "un mese", "26 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "un mese", "30 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "un mese", "45 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 mesi", "46 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 mesi", "75 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 mesi", "76 days = 3 months");
test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "un mese", "1 month = a month");
test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 mesi", "5 months = 5 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 mesi", "344 days = 11 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "un anno", "345 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "un anno", "547 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 anni", "548 days = 2 years");
test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "un anno", "1 year = a year");
test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 anni", "5 years = 5 years");
test.done();
},
"suffix" : function(test) {
test.expect(2);
moment.lang('it');
test.equal(moment(30000).from(0), "in secondi", "prefix");
test.equal(moment(0).from(30000), "secondi fa", "suffix");
test.done();
},
"fromNow" : function(test) {
test.expect(2);
moment.lang('it');
test.equal(moment().add({s:30}).fromNow(), "in secondi", "in seconds");
test.equal(moment().add({d:5}).fromNow(), "in 5 giorni", "in 5 days");
test.done();
},
"calendar day" : function(test) {
test.expect(6);
moment.lang('it');
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Oggi alle 02:00", "today at the same time");
test.equal(moment(a).add({ m: 25 }).calendar(), "Oggi alle 02:25", "Now plus 25 min");
test.equal(moment(a).add({ h: 1 }).calendar(), "Oggi alle 03:00", "Now plus 1 hour");
test.equal(moment(a).add({ d: 1 }).calendar(), "Domani alle 02:00", "tomorrow at the same time");
test.equal(moment(a).subtract({ h: 1 }).calendar(), "Oggi alle 01:00", "Now minus 1 hour");
test.equal(moment(a).subtract({ d: 1 }).calendar(), "Ieri alle 02:00", "yesterday at the same time");
test.done();
},
"calendar next week" : function(test) {
test.expect(15);
moment.lang('it');
var i;
var m;
for (i = 2; i < 7; i++) {
m = moment().add({ d: i });
test.equal(m.calendar(), m.format('dddd [alle] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [alle] LT'), "Today + " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('dddd [alle] LT'), "Today + " + i + " days end of day");
}
test.done();
},
"calendar last week" : function(test) {
test.expect(15);
moment.lang('it');
for (i = 2; i < 7; i++) {
m = moment().subtract({ d: i });
test.equal(m.calendar(), m.format('[lo scorso] dddd [alle] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[lo scorso] dddd [alle] LT'), "Today - " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('[lo scorso] dddd [alle] LT'), "Today - " + i + " days end of day");
}
test.done();
},
"calendar all else" : function(test) {
test.expect(4);
moment.lang('it');
var weeksAgo = moment().subtract({ w: 1 });
var weeksFromNow = moment().add({ w: 1 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
weeksAgo = moment().subtract({ w: 2 });
weeksFromNow = moment().add({ w: 2 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
test.done();
}
};

View File

@ -0,0 +1,208 @@
var moment = require("../../moment");
/**************************************************
Japanese
*************************************************/
exports["lang:jp"] = {
"parse" : function(test) {
test.expect(96);
moment.lang('ja');
var tests = '1月 1月_2月 2月_3月 3月_4月 4月_5月 5月_6月 6月_7月 7月_8月 8月_9月 9月_10月 10月_11月 11月_12月 12月'.split("_");
var i;
function equalTest(input, mmm, i) {
test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
}
for (i = 0; i < 12; i++) {
tests[i] = tests[i].split(' ');
equalTest(tests[i][0], 'MMM', i);
equalTest(tests[i][1], 'MMM', i);
equalTest(tests[i][0], 'MMMM', i);
equalTest(tests[i][1], 'MMMM', i);
equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
}
test.done();
},
"format" : function(test) {
test.expect(18);
moment.lang('ja');
var a = [
['dddd, MMMM Do YYYY, a h:mm:ss', '日曜日, 2月 14 2010, 午後 3:25:50'],
['ddd, Ah', '日, 午後3'],
['M Mo MM MMMM MMM', '2 2 02 2月 2月'],
['YYYY YY', '2010 10'],
['D Do DD', '14 14 14'],
['d do dddd ddd dd', '0 0 日曜日 日 日'],
['DDD DDDo DDDD', '45 45 045'],
['w wo ww', '8 8 08'],
['h hh', '3 03'],
['H HH', '15 15'],
['m mm', '25 25'],
['s ss', '50 50'],
['a A', '午後 午後'],
['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45 day of the year'],
['L', '2010/02/14'],
['LL', '2010年2月14日'],
['LLL', '2010年2月14日午後3時25分'],
['LLLL', '2010年2月14日午後3時25分 日曜日']
],
b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
i;
for (i = 0; i < a.length; i++) {
test.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
}
test.done();
},
"format month" : function(test) {
test.expect(12);
moment.lang('ja');
var expected = '1月 1月_2月 2月_3月 3月_4月 4月_5月 5月_6月 6月_7月 7月_8月 8月_9月 9月_10月 10月_11月 11月_12月 12月'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);
}
test.done();
},
"format week" : function(test) {
test.expect(7);
moment.lang('ja');
var expected = '日曜日 日 日_月曜日 月 月_火曜日 火 火_水曜日 水 水_木曜日 木 木_金曜日 金 金_土曜日 土 土'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);
}
test.done();
},
"from" : function(test) {
test.expect(30);
moment.lang('ja');
var start = moment([2007, 1, 28]);
test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "数秒", "44 seconds = a few seconds");
test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "1分", "45 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "1分", "89 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2分", "90 seconds = 2 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44分", "44 minutes = 44 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "1時間", "45 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "1時間", "89 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2時間", "90 minutes = 2 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5時間", "5 hours = 5 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21時間", "21 hours = 21 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "1日", "22 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "1日", "35 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2日", "36 hours = 2 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "1日", "1 day = a day");
test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5日", "5 days = 5 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25日", "25 days = 25 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "1ヶ月", "26 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "1ヶ月", "30 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "1ヶ月", "45 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2ヶ月", "46 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2ヶ月", "75 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3ヶ月", "76 days = 3 months");
test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "1ヶ月", "1 month = a month");
test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5ヶ月", "5 months = 5 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11ヶ月", "344 days = 11 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "1年", "345 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "1年", "547 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2年", "548 days = 2 years");
test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "1年", "1 year = a year");
test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5年", "5 years = 5 years");
test.done();
},
"suffix" : function(test) {
test.expect(2);
moment.lang('ja');
test.equal(moment(30000).from(0), "数秒後", "prefix");
test.equal(moment(0).from(30000), "数秒前", "suffix");
test.done();
},
"now from now" : function(test) {
test.expect(1);
moment.lang('ja');
test.equal(moment().fromNow(), "数秒前", "now from now should display as in the past");
test.done();
},
"fromNow" : function(test) {
test.expect(2);
moment.lang('ja');
test.equal(moment().add({s:30}).fromNow(), "数秒後", "in a few seconds");
test.equal(moment().add({d:5}).fromNow(), "5日後", "in 5 days");
test.done();
},
"calendar day" : function(test) {
test.expect(6);
moment.lang('ja');
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "今日 午前2時0分", "today at the same time");
test.equal(moment(a).add({ m: 25 }).calendar(), "今日 午前2時25分", "Now plus 25 min");
test.equal(moment(a).add({ h: 1 }).calendar(), "今日 午前3時0分", "Now plus 1 hour");
test.equal(moment(a).add({ d: 1 }).calendar(), "明日 午前2時0分", "tomorrow at the same time");
test.equal(moment(a).subtract({ h: 1 }).calendar(), "今日 午前1時0分", "Now minus 1 hour");
test.equal(moment(a).subtract({ d: 1 }).calendar(), "昨日 午前2時0分", "yesterday at the same time");
test.done();
},
"calendar next week" : function(test) {
test.expect(15);
moment.lang('ja');
var i;
var m;
for (i = 2; i < 7; i++) {
m = moment().add({ d: i });
test.equal(m.calendar(), m.format('[来週]dddd LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[来週]dddd LT'), "Today + " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('[来週]dddd LT'), "Today + " + i + " days end of day");
}
test.done();
},
"calendar last week" : function(test) {
test.expect(15);
moment.lang('ja');
for (i = 2; i < 7; i++) {
m = moment().subtract({ d: i });
test.equal(m.calendar(), m.format('[前週]dddd LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[前週]dddd LT'), "Today - " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('[前週]dddd LT'), "Today - " + i + " days end of day");
}
test.done();
},
"calendar all else" : function(test) {
test.expect(4);
moment.lang('ja');
var weeksAgo = moment().subtract({ w: 1 });
var weeksFromNow = moment().add({ w: 1 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
weeksAgo = moment().subtract({ w: 2 });
weeksFromNow = moment().add({ w: 2 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
test.done();
}
};

View File

@ -0,0 +1,208 @@
var moment = require("../../moment");
/**************************************************
Japanese
*************************************************/
exports["lang:jp"] = {
"parse" : function(test) {
test.expect(96);
moment.lang('jp');
var tests = '1月 1月_2月 2月_3月 3月_4月 4月_5月 5月_6月 6月_7月 7月_8月 8月_9月 9月_10月 10月_11月 11月_12月 12月'.split("_");
var i;
function equalTest(input, mmm, i) {
test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
}
for (i = 0; i < 12; i++) {
tests[i] = tests[i].split(' ');
equalTest(tests[i][0], 'MMM', i);
equalTest(tests[i][1], 'MMM', i);
equalTest(tests[i][0], 'MMMM', i);
equalTest(tests[i][1], 'MMMM', i);
equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
}
test.done();
},
"format" : function(test) {
test.expect(18);
moment.lang('jp');
var a = [
['dddd, MMMM Do YYYY, a h:mm:ss', '日曜日, 2月 14 2010, 午後 3:25:50'],
['ddd, Ah', '日, 午後3'],
['M Mo MM MMMM MMM', '2 2 02 2月 2月'],
['YYYY YY', '2010 10'],
['D Do DD', '14 14 14'],
['d do dddd ddd dd', '0 0 日曜日 日 日'],
['DDD DDDo DDDD', '45 45 045'],
['w wo ww', '8 8 08'],
['h hh', '3 03'],
['H HH', '15 15'],
['m mm', '25 25'],
['s ss', '50 50'],
['a A', '午後 午後'],
['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45 day of the year'],
['L', '2010/02/14'],
['LL', '2010年2月14日'],
['LLL', '2010年2月14日午後3時25分'],
['LLLL', '2010年2月14日午後3時25分 日曜日']
],
b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
i;
for (i = 0; i < a.length; i++) {
test.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
}
test.done();
},
"format month" : function(test) {
test.expect(12);
moment.lang('jp');
var expected = '1月 1月_2月 2月_3月 3月_4月 4月_5月 5月_6月 6月_7月 7月_8月 8月_9月 9月_10月 10月_11月 11月_12月 12月'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);
}
test.done();
},
"format week" : function(test) {
test.expect(7);
moment.lang('jp');
var expected = '日曜日 日 日_月曜日 月 月_火曜日 火 火_水曜日 水 水_木曜日 木 木_金曜日 金 金_土曜日 土 土'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);
}
test.done();
},
"from" : function(test) {
test.expect(30);
moment.lang('jp');
var start = moment([2007, 1, 28]);
test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "数秒", "44 seconds = a few seconds");
test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "1分", "45 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "1分", "89 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2分", "90 seconds = 2 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44分", "44 minutes = 44 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "1時間", "45 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "1時間", "89 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2時間", "90 minutes = 2 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5時間", "5 hours = 5 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21時間", "21 hours = 21 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "1日", "22 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "1日", "35 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2日", "36 hours = 2 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "1日", "1 day = a day");
test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5日", "5 days = 5 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25日", "25 days = 25 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "1ヶ月", "26 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "1ヶ月", "30 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "1ヶ月", "45 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2ヶ月", "46 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2ヶ月", "75 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3ヶ月", "76 days = 3 months");
test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "1ヶ月", "1 month = a month");
test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5ヶ月", "5 months = 5 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11ヶ月", "344 days = 11 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "1年", "345 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "1年", "547 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2年", "548 days = 2 years");
test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "1年", "1 year = a year");
test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5年", "5 years = 5 years");
test.done();
},
"suffix" : function(test) {
test.expect(2);
moment.lang('jp');
test.equal(moment(30000).from(0), "数秒後", "prefix");
test.equal(moment(0).from(30000), "数秒前", "suffix");
test.done();
},
"now from now" : function(test) {
test.expect(1);
moment.lang('jp');
test.equal(moment().fromNow(), "数秒前", "now from now should display as in the past");
test.done();
},
"fromNow" : function(test) {
test.expect(2);
moment.lang('jp');
test.equal(moment().add({s:30}).fromNow(), "数秒後", "in a few seconds");
test.equal(moment().add({d:5}).fromNow(), "5日後", "in 5 days");
test.done();
},
"calendar day" : function(test) {
test.expect(6);
moment.lang('jp');
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "今日 午前2時0分", "today at the same time");
test.equal(moment(a).add({ m: 25 }).calendar(), "今日 午前2時25分", "Now plus 25 min");
test.equal(moment(a).add({ h: 1 }).calendar(), "今日 午前3時0分", "Now plus 1 hour");
test.equal(moment(a).add({ d: 1 }).calendar(), "明日 午前2時0分", "tomorrow at the same time");
test.equal(moment(a).subtract({ h: 1 }).calendar(), "今日 午前1時0分", "Now minus 1 hour");
test.equal(moment(a).subtract({ d: 1 }).calendar(), "昨日 午前2時0分", "yesterday at the same time");
test.done();
},
"calendar next week" : function(test) {
test.expect(15);
moment.lang('jp');
var i;
var m;
for (i = 2; i < 7; i++) {
m = moment().add({ d: i });
test.equal(m.calendar(), m.format('[来週]dddd LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[来週]dddd LT'), "Today + " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('[来週]dddd LT'), "Today + " + i + " days end of day");
}
test.done();
},
"calendar last week" : function(test) {
test.expect(15);
moment.lang('jp');
for (i = 2; i < 7; i++) {
m = moment().subtract({ d: i });
test.equal(m.calendar(), m.format('[前週]dddd LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[前週]dddd LT'), "Today - " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('[前週]dddd LT'), "Today - " + i + " days end of day");
}
test.done();
},
"calendar all else" : function(test) {
test.expect(4);
moment.lang('jp');
var weeksAgo = moment().subtract({ w: 1 });
var weeksFromNow = moment().add({ w: 1 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
weeksAgo = moment().subtract({ w: 2 });
weeksFromNow = moment().add({ w: 2 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
test.done();
}
};

View File

@ -0,0 +1,247 @@
var moment = require("../../moment");
/**************************************************
Korean
*************************************************/
exports["lang:kr"] = {
"parse" : function(test) {
test.expect(96);
moment.lang('ko');
var tests = '1월 1월_2월 2월_3월 3월_4월 4월_5월 5월_6월 6월_7월 7월_8월 8월_9월 9월_10월 10월_11월 11월_12월 12월'.split("_");
var i;
function equalTest(input, mmm, i) {
test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
}
for (i = 0; i < 12; i++) {
tests[i] = tests[i].split(' ');
equalTest(tests[i][0], 'MMM', i);
equalTest(tests[i][1], 'MMM', i);
equalTest(tests[i][0], 'MMMM', i);
equalTest(tests[i][1], 'MMMM', i);
equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
}
test.done();
},
"format" : function(test) {
test.expect(18);
moment.lang('ko');
var a = [
['YYYY년 MMMM Do dddd a h:mm:ss', '2010년 2월 14일 일요일 오후 3:25:50'],
['ddd A h', '일 오후 3'],
['M Mo MM MMMM MMM', '2 2일 02 2월 2월'],
['YYYY YY', '2010 10'],
['D Do DD', '14 14일 14'],
['d do dddd ddd dd', '0 0일 일요일 일 일'],
['DDD DDDo DDDD', '45 45일 045'],
['w wo ww', '8 8일 08'],
['h hh', '3 03'],
['H HH', '15 15'],
['m mm', '25 25'],
['s ss', '50 50'],
['a A', '오후 오후'],
['일년 중 DDDo째 되는 날', '일년 중 45일째 되는 날'],
['L', '2010.02.14'],
['LL', '2010년 2월 14일'],
['LLL', '2010년 2월 14일 오후 3시 25분'],
['LLLL', '2010년 2월 14일 일요일 오후 3시 25분']
],
b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
i;
for (i = 0; i < a.length; i++) {
test.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
}
test.done();
},
"format ordinal" : function(test) {
test.expect(31);
moment.lang('ko');
test.equal(moment([2011, 0, 1]).format('DDDo'), '1일', '1일');
test.equal(moment([2011, 0, 2]).format('DDDo'), '2일', '2일');
test.equal(moment([2011, 0, 3]).format('DDDo'), '3일', '3일');
test.equal(moment([2011, 0, 4]).format('DDDo'), '4일', '4일');
test.equal(moment([2011, 0, 5]).format('DDDo'), '5일', '5일');
test.equal(moment([2011, 0, 6]).format('DDDo'), '6일', '6일');
test.equal(moment([2011, 0, 7]).format('DDDo'), '7일', '7일');
test.equal(moment([2011, 0, 8]).format('DDDo'), '8일', '8일');
test.equal(moment([2011, 0, 9]).format('DDDo'), '9일', '9일');
test.equal(moment([2011, 0, 10]).format('DDDo'), '10일', '10일');
test.equal(moment([2011, 0, 11]).format('DDDo'), '11일', '11일');
test.equal(moment([2011, 0, 12]).format('DDDo'), '12일', '12일');
test.equal(moment([2011, 0, 13]).format('DDDo'), '13일', '13일');
test.equal(moment([2011, 0, 14]).format('DDDo'), '14일', '14일');
test.equal(moment([2011, 0, 15]).format('DDDo'), '15일', '15일');
test.equal(moment([2011, 0, 16]).format('DDDo'), '16일', '16일');
test.equal(moment([2011, 0, 17]).format('DDDo'), '17일', '17일');
test.equal(moment([2011, 0, 18]).format('DDDo'), '18일', '18일');
test.equal(moment([2011, 0, 19]).format('DDDo'), '19일', '19일');
test.equal(moment([2011, 0, 20]).format('DDDo'), '20일', '20일');
test.equal(moment([2011, 0, 21]).format('DDDo'), '21일', '21일');
test.equal(moment([2011, 0, 22]).format('DDDo'), '22일', '22일');
test.equal(moment([2011, 0, 23]).format('DDDo'), '23일', '23일');
test.equal(moment([2011, 0, 24]).format('DDDo'), '24일', '24일');
test.equal(moment([2011, 0, 25]).format('DDDo'), '25일', '25일');
test.equal(moment([2011, 0, 26]).format('DDDo'), '26일', '26일');
test.equal(moment([2011, 0, 27]).format('DDDo'), '27일', '27일');
test.equal(moment([2011, 0, 28]).format('DDDo'), '28일', '28일');
test.equal(moment([2011, 0, 29]).format('DDDo'), '29일', '29일');
test.equal(moment([2011, 0, 30]).format('DDDo'), '30일', '30일');
test.equal(moment([2011, 0, 31]).format('DDDo'), '31일', '31일');
test.done();
},
"format month" : function(test) {
test.expect(12);
moment.lang('ko');
var expected = '1월 1월_2월 2월_3월 3월_4월 4월_5월 5월_6월 6월_7월 7월_8월 8월_9월 9월_10월 10월_11월 11월_12월 12월'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);
}
test.done();
},
"format week" : function(test) {
test.expect(7);
moment.lang('ko');
var expected = '일요일 일 일_월요일 월 월_화요일 화 화_수요일 수 수_목요일 목 목_금요일 금 금_토요일 토 토'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);
}
test.done();
},
"from" : function(test) {
test.expect(30);
moment.lang('ko');
var start = moment([2007, 1, 28]);
test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "몇초", "44초 = 몇초");
test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "일분", "45초 = 일분");
test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "일분", "89초 = 일분");
test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2분", "90초 = 2분");
test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44분", "44분 = 44분");
test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "한시간", "45분 = 한시간");
test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "한시간", "89분 = 한시간");
test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2시간", "90분 = 2시간");
test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5시간", "5시간 = 5시간");
test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21시간", "21시간 = 21시간");
test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "하루", "22시간 = 하루");
test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "하루", "35시간 = 하루");
test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2일", "36시간 = 2일");
test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "하루", "하루 = 하루");
test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5일", "5일 = 5일");
test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25일", "25일 = 25일");
test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "한달", "26일 = 한달");
test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "한달", "30일 = 한달");
test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "한달", "45일 = 한달");
test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2달", "46일 = 2달");
test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2달", "75일 = 2달");
test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3달", "76일 = 3달");
test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "한달", "1달 = 한달");
test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5달", "5달 = 5달");
test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11달", "344일 = 11달");
test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "일년", "345일 = 일년");
test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "일년", "547일 = 일년");
test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2년", "548일 = 2년");
test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "일년", "일년 = 일년");
test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5년", "5년 = 5년");
test.done();
},
"suffix" : function(test) {
test.expect(2);
moment.lang('ko');
test.equal(moment(30000).from(0), "몇초 후", "prefix");
test.equal(moment(0).from(30000), "몇초 전", "suffix");
test.done();
},
"now from now" : function(test) {
test.expect(1);
moment.lang('ko');
test.equal(moment().fromNow(), "몇초 전", "now from now should display as in the past");
test.done();
},
"fromNow" : function(test) {
test.expect(2);
moment.lang('ko');
test.equal(moment().add({s:30}).fromNow(), "몇초 후", "in a few seconds");
test.equal(moment().add({d:5}).fromNow(), "5일 후", "in 5 days");
test.done();
},
"calendar day" : function(test) {
test.expect(6);
moment.lang('ko');
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "오늘 오전 2시 00분", "today at the same time");
test.equal(moment(a).add({ m: 25 }).calendar(), "오늘 오전 2시 25분", "Now plus 25 min");
test.equal(moment(a).add({ h: 1 }).calendar(), "오늘 오전 3시 00분", "Now plus 1 hour");
test.equal(moment(a).add({ d: 1 }).calendar(), "내일 오전 2시 00분", "tomorrow at the same time");
test.equal(moment(a).subtract({ h: 1 }).calendar(), "오늘 오전 1시 00분", "Now minus 1 hour");
test.equal(moment(a).subtract({ d: 1 }).calendar(), "어제 오전 2시 00분", "yesterday at the same time");
test.done();
},
"calendar next week" : function(test) {
test.expect(15);
moment.lang('ko');
var i;
var m;
for (i = 2; i < 7; i++) {
m = moment().add({ d: i });
test.equal(m.calendar(), m.format('dddd LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd LT'), "Today + " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('dddd LT'), "Today + " + i + " days end of day");
}
test.done();
},
"calendar last week" : function(test) {
test.expect(15);
moment.lang('ko');
for (i = 2; i < 7; i++) {
m = moment().subtract({ d: i });
test.equal(m.calendar(), m.format('지난주 dddd LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('지난주 dddd LT'), "Today - " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('지난주 dddd LT'), "Today - " + i + " days end of day");
}
test.done();
},
"calendar all else" : function(test) {
test.expect(4);
moment.lang('ko');
var weeksAgo = moment().subtract({ w: 1 });
var weeksFromNow = moment().add({ w: 1 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
weeksAgo = moment().subtract({ w: 2 });
weeksFromNow = moment().add({ w: 2 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
test.done();
}
};

View File

@ -0,0 +1,247 @@
var moment = require("../../moment");
/**************************************************
Korean
*************************************************/
exports["lang:kr"] = {
"parse" : function(test) {
test.expect(96);
moment.lang('kr');
var tests = '1월 1월_2월 2월_3월 3월_4월 4월_5월 5월_6월 6월_7월 7월_8월 8월_9월 9월_10월 10월_11월 11월_12월 12월'.split("_");
var i;
function equalTest(input, mmm, i) {
test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
}
for (i = 0; i < 12; i++) {
tests[i] = tests[i].split(' ');
equalTest(tests[i][0], 'MMM', i);
equalTest(tests[i][1], 'MMM', i);
equalTest(tests[i][0], 'MMMM', i);
equalTest(tests[i][1], 'MMMM', i);
equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
}
test.done();
},
"format" : function(test) {
test.expect(18);
moment.lang('kr');
var a = [
['YYYY년 MMMM Do dddd a h:mm:ss', '2010년 2월 14일 일요일 오후 3:25:50'],
['ddd A h', '일 오후 3'],
['M Mo MM MMMM MMM', '2 2일 02 2월 2월'],
['YYYY YY', '2010 10'],
['D Do DD', '14 14일 14'],
['d do dddd ddd dd', '0 0일 일요일 일 일'],
['DDD DDDo DDDD', '45 45일 045'],
['w wo ww', '8 8일 08'],
['h hh', '3 03'],
['H HH', '15 15'],
['m mm', '25 25'],
['s ss', '50 50'],
['a A', '오후 오후'],
['일년 중 DDDo째 되는 날', '일년 중 45일째 되는 날'],
['L', '2010.02.14'],
['LL', '2010년 2월 14일'],
['LLL', '2010년 2월 14일 오후 3시 25분'],
['LLLL', '2010년 2월 14일 일요일 오후 3시 25분']
],
b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
i;
for (i = 0; i < a.length; i++) {
test.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
}
test.done();
},
"format ordinal" : function(test) {
test.expect(31);
moment.lang('kr');
test.equal(moment([2011, 0, 1]).format('DDDo'), '1일', '1일');
test.equal(moment([2011, 0, 2]).format('DDDo'), '2일', '2일');
test.equal(moment([2011, 0, 3]).format('DDDo'), '3일', '3일');
test.equal(moment([2011, 0, 4]).format('DDDo'), '4일', '4일');
test.equal(moment([2011, 0, 5]).format('DDDo'), '5일', '5일');
test.equal(moment([2011, 0, 6]).format('DDDo'), '6일', '6일');
test.equal(moment([2011, 0, 7]).format('DDDo'), '7일', '7일');
test.equal(moment([2011, 0, 8]).format('DDDo'), '8일', '8일');
test.equal(moment([2011, 0, 9]).format('DDDo'), '9일', '9일');
test.equal(moment([2011, 0, 10]).format('DDDo'), '10일', '10일');
test.equal(moment([2011, 0, 11]).format('DDDo'), '11일', '11일');
test.equal(moment([2011, 0, 12]).format('DDDo'), '12일', '12일');
test.equal(moment([2011, 0, 13]).format('DDDo'), '13일', '13일');
test.equal(moment([2011, 0, 14]).format('DDDo'), '14일', '14일');
test.equal(moment([2011, 0, 15]).format('DDDo'), '15일', '15일');
test.equal(moment([2011, 0, 16]).format('DDDo'), '16일', '16일');
test.equal(moment([2011, 0, 17]).format('DDDo'), '17일', '17일');
test.equal(moment([2011, 0, 18]).format('DDDo'), '18일', '18일');
test.equal(moment([2011, 0, 19]).format('DDDo'), '19일', '19일');
test.equal(moment([2011, 0, 20]).format('DDDo'), '20일', '20일');
test.equal(moment([2011, 0, 21]).format('DDDo'), '21일', '21일');
test.equal(moment([2011, 0, 22]).format('DDDo'), '22일', '22일');
test.equal(moment([2011, 0, 23]).format('DDDo'), '23일', '23일');
test.equal(moment([2011, 0, 24]).format('DDDo'), '24일', '24일');
test.equal(moment([2011, 0, 25]).format('DDDo'), '25일', '25일');
test.equal(moment([2011, 0, 26]).format('DDDo'), '26일', '26일');
test.equal(moment([2011, 0, 27]).format('DDDo'), '27일', '27일');
test.equal(moment([2011, 0, 28]).format('DDDo'), '28일', '28일');
test.equal(moment([2011, 0, 29]).format('DDDo'), '29일', '29일');
test.equal(moment([2011, 0, 30]).format('DDDo'), '30일', '30일');
test.equal(moment([2011, 0, 31]).format('DDDo'), '31일', '31일');
test.done();
},
"format month" : function(test) {
test.expect(12);
moment.lang('kr');
var expected = '1월 1월_2월 2월_3월 3월_4월 4월_5월 5월_6월 6월_7월 7월_8월 8월_9월 9월_10월 10월_11월 11월_12월 12월'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);
}
test.done();
},
"format week" : function(test) {
test.expect(7);
moment.lang('kr');
var expected = '일요일 일 일_월요일 월 월_화요일 화 화_수요일 수 수_목요일 목 목_금요일 금 금_토요일 토 토'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);
}
test.done();
},
"from" : function(test) {
test.expect(30);
moment.lang('kr');
var start = moment([2007, 1, 28]);
test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "몇초", "44초 = 몇초");
test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "일분", "45초 = 일분");
test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "일분", "89초 = 일분");
test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2분", "90초 = 2분");
test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44분", "44분 = 44분");
test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "한시간", "45분 = 한시간");
test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "한시간", "89분 = 한시간");
test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2시간", "90분 = 2시간");
test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5시간", "5시간 = 5시간");
test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21시간", "21시간 = 21시간");
test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "하루", "22시간 = 하루");
test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "하루", "35시간 = 하루");
test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2일", "36시간 = 2일");
test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "하루", "하루 = 하루");
test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5일", "5일 = 5일");
test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25일", "25일 = 25일");
test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "한달", "26일 = 한달");
test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "한달", "30일 = 한달");
test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "한달", "45일 = 한달");
test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2달", "46일 = 2달");
test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2달", "75일 = 2달");
test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3달", "76일 = 3달");
test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "한달", "1달 = 한달");
test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5달", "5달 = 5달");
test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11달", "344일 = 11달");
test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "일년", "345일 = 일년");
test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "일년", "547일 = 일년");
test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2년", "548일 = 2년");
test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "일년", "일년 = 일년");
test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5년", "5년 = 5년");
test.done();
},
"suffix" : function(test) {
test.expect(2);
moment.lang('kr');
test.equal(moment(30000).from(0), "몇초 후", "prefix");
test.equal(moment(0).from(30000), "몇초 전", "suffix");
test.done();
},
"now from now" : function(test) {
test.expect(1);
moment.lang('kr');
test.equal(moment().fromNow(), "몇초 전", "now from now should display as in the past");
test.done();
},
"fromNow" : function(test) {
test.expect(2);
moment.lang('kr');
test.equal(moment().add({s:30}).fromNow(), "몇초 후", "in a few seconds");
test.equal(moment().add({d:5}).fromNow(), "5일 후", "in 5 days");
test.done();
},
"calendar day" : function(test) {
test.expect(6);
moment.lang('kr');
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "오늘 오전 2시 00분", "today at the same time");
test.equal(moment(a).add({ m: 25 }).calendar(), "오늘 오전 2시 25분", "Now plus 25 min");
test.equal(moment(a).add({ h: 1 }).calendar(), "오늘 오전 3시 00분", "Now plus 1 hour");
test.equal(moment(a).add({ d: 1 }).calendar(), "내일 오전 2시 00분", "tomorrow at the same time");
test.equal(moment(a).subtract({ h: 1 }).calendar(), "오늘 오전 1시 00분", "Now minus 1 hour");
test.equal(moment(a).subtract({ d: 1 }).calendar(), "어제 오전 2시 00분", "yesterday at the same time");
test.done();
},
"calendar next week" : function(test) {
test.expect(15);
moment.lang('kr');
var i;
var m;
for (i = 2; i < 7; i++) {
m = moment().add({ d: i });
test.equal(m.calendar(), m.format('dddd LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd LT'), "Today + " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('dddd LT'), "Today + " + i + " days end of day");
}
test.done();
},
"calendar last week" : function(test) {
test.expect(15);
moment.lang('kr');
for (i = 2; i < 7; i++) {
m = moment().subtract({ d: i });
test.equal(m.calendar(), m.format('지난주 dddd LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('지난주 dddd LT'), "Today - " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('지난주 dddd LT'), "Today - " + i + " days end of day");
}
test.done();
},
"calendar all else" : function(test) {
test.expect(4);
moment.lang('kr');
var weeksAgo = moment().subtract({ w: 1 });
var weeksFromNow = moment().add({ w: 1 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
weeksAgo = moment().subtract({ w: 2 });
weeksFromNow = moment().add({ w: 2 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
test.done();
}
};

View File

@ -0,0 +1,248 @@
var moment = require("../../moment");
/**************************************************
Norwegian bokmål
*************************************************/
exports["lang:nb"] = {
"parse" : function(test) {
test.expect(96);
moment.lang('nb');
var tests = 'januar jan_februar feb_mars mar_april apr_mai mai_juni jun_juli jul_august aug_september sep_oktober okt_november nov_desember des'.split("_");
var i;
function equalTest(input, mmm, i) {
test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
}
for (i = 0; i < 12; i++) {
tests[i] = tests[i].split(' ');
equalTest(tests[i][0], 'MMM', i);
equalTest(tests[i][1], 'MMM', i);
equalTest(tests[i][0], 'MMMM', i);
equalTest(tests[i][1], 'MMMM', i);
equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
}
test.done();
},
"format" : function(test) {
test.expect(18);
moment.lang('nb');
var a = [
['dddd, MMMM Do YYYY, h:mm:ss a', 'søndag, februar 14. 2010, 3:25:50 pm'],
['ddd, hA', 'søn, 3PM'],
['M Mo MM MMMM MMM', '2 2. 02 februar feb'],
['YYYY YY', '2010 10'],
['D Do DD', '14 14. 14'],
['d do dddd ddd dd', '0 0. søndag søn sø'],
['DDD DDDo DDDD', '45 45. 045'],
['w wo ww', '8 8. 08'],
['h hh', '3 03'],
['H HH', '15 15'],
['m mm', '25 25'],
['s ss', '50 50'],
['a A', 'pm PM'],
['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45. day of the year'],
['L', '2010-02-14'],
['LL', '14 februar 2010'],
['LLL', '14 februar 2010 15:25'],
['LLLL', 'søndag 14 februar 2010 15:25']
],
b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
i;
for (i = 0; i < a.length; i++) {
test.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
}
test.done();
},
"format ordinal" : function(test) {
test.expect(31);
moment.lang('nb');
test.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
test.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
test.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
test.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');
test.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');
test.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');
test.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');
test.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');
test.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');
test.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');
test.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');
test.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');
test.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');
test.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');
test.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');
test.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');
test.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');
test.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');
test.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');
test.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');
test.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');
test.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');
test.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');
test.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');
test.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');
test.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');
test.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');
test.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');
test.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');
test.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');
test.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');
test.done();
},
"format month" : function(test) {
test.expect(12);
moment.lang('nb');
var expected = 'januar jan_februar feb_mars mar_april apr_mai mai_juni jun_juli jul_august aug_september sep_oktober okt_november nov_desember des'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);
}
test.done();
},
"format week" : function(test) {
test.expect(7);
moment.lang('nb');
var expected = 'søndag søn sø_mandag man ma_tirsdag tir ti_onsdag ons on_torsdag tor to_fredag fre fr_lørdag lør lø'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);
}
test.done();
},
"from" : function(test) {
test.expect(30);
moment.lang('nb');
var start = moment([2007, 1, 28]);
test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "noen sekunder", "44 sekunder = a few seconds");
test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "ett minutt", "45 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "ett minutt", "89 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutter", "90 seconds = 2 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutter", "44 minutes = 44 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "en time", "45 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "en time", "89 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 timer", "90 minutes = 2 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 timer", "5 hours = 5 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 timer", "21 hours = 21 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "en dag", "22 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "en dag", "35 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dager", "36 hours = 2 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "en dag", "1 day = a day");
test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dager", "5 days = 5 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dager", "25 days = 25 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "en måned", "26 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "en måned", "30 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "en måned", "45 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 måneder", "46 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 måneder", "75 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 måneder", "76 days = 3 months");
test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "en måned", "1 month = a month");
test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 måneder", "5 months = 5 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 måneder", "344 days = 11 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "ett år", "345 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "ett år", "547 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 år", "548 days = 2 years");
test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "ett år", "1 year = a year");
test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 år", "5 years = 5 years");
test.done();
},
"suffix" : function(test) {
test.expect(2);
moment.lang('nb');
test.equal(moment(30000).from(0), "om noen sekunder", "prefix");
test.equal(moment(0).from(30000), "for noen sekunder siden", "suffix");
test.done();
},
"now from now" : function(test) {
test.expect(1);
moment.lang('nb');
test.equal(moment().fromNow(), "for noen sekunder siden", "now from now should display as in the past");
test.done();
},
"fromNow" : function(test) {
test.expect(2);
moment.lang('nb');
test.equal(moment().add({s:30}).fromNow(), "om noen sekunder", "in a few seconds");
test.equal(moment().add({d:5}).fromNow(), "om 5 dager", "in 5 days");
test.done();
},
"calendar day" : function(test) {
test.expect(6);
moment.lang('nb');
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "I dag klokken 02:00", "today at the same time");
test.equal(moment(a).add({ m: 25 }).calendar(), "I dag klokken 02:25", "Now plus 25 min");
test.equal(moment(a).add({ h: 1 }).calendar(), "I dag klokken 03:00", "Now plus 1 hour");
test.equal(moment(a).add({ d: 1 }).calendar(), "I morgen klokken 02:00", "tomorrow at the same time");
test.equal(moment(a).subtract({ h: 1 }).calendar(), "I dag klokken 01:00", "Now minus 1 hour");
test.equal(moment(a).subtract({ d: 1 }).calendar(), "I går klokken 02:00", "yesterday at the same time");
test.done();
},
"calendar next week" : function(test) {
test.expect(15);
moment.lang('nb');
var i;
var m;
for (i = 2; i < 7; i++) {
m = moment().add({ d: i });
test.equal(m.calendar(), m.format('dddd [klokken] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [klokken] LT'), "Today + " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('dddd [klokken] LT'), "Today + " + i + " days end of day");
}
test.done();
},
"calendar last week" : function(test) {
test.expect(15);
moment.lang('nb');
for (i = 2; i < 7; i++) {
m = moment().subtract({ d: i });
test.equal(m.calendar(), m.format('[Forrige] dddd [klokken] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[Forrige] dddd [klokken] LT'), "Today - " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('[Forrige] dddd [klokken] LT'), "Today - " + i + " days end of day");
}
test.done();
},
"calendar all else" : function(test) {
test.expect(4);
moment.lang('nb');
var weeksAgo = moment().subtract({ w: 1 });
var weeksFromNow = moment().add({ w: 1 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
weeksAgo = moment().subtract({ w: 2 });
weeksFromNow = moment().add({ w: 2 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
test.done();
}
};

View File

@ -0,0 +1,258 @@
var moment = require("../../moment");
/**************************************************
Dutch
*************************************************/
exports["lang:nl"] = {
"parse" : function(test) {
test.expect(96);
moment.lang('nl');
var tests = 'januari jan._februari feb._maart mrt._april apr._mei mei._juni jun._juli jul._augustus aug._september sep._oktober okt._november nov._december dec.'.split("_");
var i;
function equalTest(input, mmm, i) {
test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
}
for (i = 0; i < 12; i++) {
tests[i] = tests[i].split(' ');
equalTest(tests[i][0], 'MMM', i);
equalTest(tests[i][1], 'MMM', i);
equalTest(tests[i][0], 'MMMM', i);
equalTest(tests[i][1], 'MMMM', i);
equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
}
test.done();
},
"format" : function(test) {
test.expect(18);
moment.lang('nl');
var a = [
['dddd, MMMM Do YYYY, HH:mm:ss', 'zondag, februari 14de 2010, 15:25:50'],
['ddd, HH', 'zo., 15'],
['M Mo MM MMMM MMM', '2 2de 02 februari feb.'],
['YYYY YY', '2010 10'],
['D Do DD', '14 14de 14'],
['d do dddd ddd dd', '0 0de zondag zo. Zo'],
['DDD DDDo DDDD', '45 45ste 045'],
['w wo ww', '8 8ste 08'],
['h hh', '3 03'],
['H HH', '15 15'],
['m mm', '25 25'],
['s ss', '50 50'],
['a A', 'pm PM'],
['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45ste day of the year'],
['L', '14-02-2010'],
['LL', '14 februari 2010'],
['LLL', '14 februari 2010 15:25'],
['LLLL', 'zondag 14 februari 2010 15:25']
],
b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
i;
for (i = 0; i < a.length; i++) {
test.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
}
test.done();
},
"format ordinal" : function(test) {
test.expect(31);
moment.lang('nl');
test.equal(moment([2011, 0, 1]).format('DDDo'), '1ste', '1ste');
test.equal(moment([2011, 0, 2]).format('DDDo'), '2de', '2de');
test.equal(moment([2011, 0, 3]).format('DDDo'), '3de', '3de');
test.equal(moment([2011, 0, 4]).format('DDDo'), '4de', '4de');
test.equal(moment([2011, 0, 5]).format('DDDo'), '5de', '5de');
test.equal(moment([2011, 0, 6]).format('DDDo'), '6de', '6de');
test.equal(moment([2011, 0, 7]).format('DDDo'), '7de', '7de');
test.equal(moment([2011, 0, 8]).format('DDDo'), '8ste', '8ste');
test.equal(moment([2011, 0, 9]).format('DDDo'), '9de', '9de');
test.equal(moment([2011, 0, 10]).format('DDDo'), '10de', '10de');
test.equal(moment([2011, 0, 11]).format('DDDo'), '11de', '11de');
test.equal(moment([2011, 0, 12]).format('DDDo'), '12de', '12de');
test.equal(moment([2011, 0, 13]).format('DDDo'), '13de', '13de');
test.equal(moment([2011, 0, 14]).format('DDDo'), '14de', '14de');
test.equal(moment([2011, 0, 15]).format('DDDo'), '15de', '15de');
test.equal(moment([2011, 0, 16]).format('DDDo'), '16de', '16de');
test.equal(moment([2011, 0, 17]).format('DDDo'), '17de', '17de');
test.equal(moment([2011, 0, 18]).format('DDDo'), '18de', '18de');
test.equal(moment([2011, 0, 19]).format('DDDo'), '19de', '19de');
test.equal(moment([2011, 0, 20]).format('DDDo'), '20ste', '20ste');
test.equal(moment([2011, 0, 21]).format('DDDo'), '21ste', '21ste');
test.equal(moment([2011, 0, 22]).format('DDDo'), '22ste', '22ste');
test.equal(moment([2011, 0, 23]).format('DDDo'), '23ste', '23ste');
test.equal(moment([2011, 0, 24]).format('DDDo'), '24ste', '24ste');
test.equal(moment([2011, 0, 25]).format('DDDo'), '25ste', '25ste');
test.equal(moment([2011, 0, 26]).format('DDDo'), '26ste', '26ste');
test.equal(moment([2011, 0, 27]).format('DDDo'), '27ste', '27ste');
test.equal(moment([2011, 0, 28]).format('DDDo'), '28ste', '28ste');
test.equal(moment([2011, 0, 29]).format('DDDo'), '29ste', '29ste');
test.equal(moment([2011, 0, 30]).format('DDDo'), '30ste', '30ste');
test.equal(moment([2011, 0, 31]).format('DDDo'), '31ste', '31ste');
test.done();
},
"format month" : function(test) {
test.expect(12);
moment.lang('nl');
var expected = 'januari jan._februari feb._maart mrt._april apr._mei mei_juni jun._juli jul._augustus aug._september sep._oktober okt._november nov._december dec.'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);
}
test.done();
},
"format week" : function(test) {
test.expect(7);
moment.lang('nl');
var expected = 'zondag zo. Zo_maandag ma. Ma_dinsdag di. Di_woensdag wo. Wo_donderdag do. Do_vrijdag vr. Vr_zaterdag za. Za'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);
}
test.done();
},
"from" : function(test) {
test.expect(30);
moment.lang('nl');
var start = moment([2007, 1, 28]);
test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "een paar seconden", "44 seconds = a few seconds");
test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "één minuut", "45 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "één minuut", "89 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minuten", "90 seconds = 2 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minuten", "44 minutes = 44 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "één uur", "45 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "één uur", "89 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 uur", "90 minutes = 2 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 uur", "5 hours = 5 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 uur", "21 hours = 21 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "één dag", "22 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "één dag", "35 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dagen", "36 hours = 2 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "één dag", "1 day = a day");
test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dagen", "5 days = 5 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dagen", "25 days = 25 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "één maand", "26 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "één maand", "30 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "één maand", "45 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 maanden", "46 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 maanden", "75 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 maanden", "76 days = 3 months");
test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "één maand", "1 month = a month");
test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 maanden", "5 months = 5 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 maanden", "344 days = 11 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "één jaar", "345 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "één jaar", "547 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 jaar", "548 days = 2 years");
test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "één jaar", "1 year = a year");
test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 jaar", "5 years = 5 years");
test.done();
},
"suffix" : function(test) {
test.expect(2);
moment.lang('nl');
test.equal(moment(30000).from(0), "over een paar seconden", "prefix");
test.equal(moment(0).from(30000), "een paar seconden geleden", "suffix");
test.done();
},
"now from now" : function(test) {
test.expect(1);
moment.lang('nl');
test.equal(moment().fromNow(), "een paar seconden geleden", "now from now should display as in the past");
test.done();
},
"fromNow" : function(test) {
test.expect(2);
moment.lang('nl');
test.equal(moment().add({s:30}).fromNow(), "over een paar seconden", "in a few seconds");
test.equal(moment().add({d:5}).fromNow(), "over 5 dagen", "in 5 days");
test.done();
},
"calendar day" : function(test) {
test.expect(6);
moment.lang('nl');
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Vandaag om 02:00", "today at the same time");
test.equal(moment(a).add({ m: 25 }).calendar(), "Vandaag om 02:25", "Now plus 25 min");
test.equal(moment(a).add({ h: 1 }).calendar(), "Vandaag om 03:00", "Now plus 1 hour");
test.equal(moment(a).add({ d: 1 }).calendar(), "Morgen om 02:00", "tomorrow at the same time");
test.equal(moment(a).subtract({ h: 1 }).calendar(), "Vandaag om 01:00", "Now minus 1 hour");
test.equal(moment(a).subtract({ d: 1 }).calendar(), "Gisteren om 02:00", "yesterday at the same time");
test.done();
},
"calendar next week" : function(test) {
test.expect(15);
moment.lang('nl');
var i;
var m;
for (i = 2; i < 7; i++) {
m = moment().add({ d: i });
test.equal(m.calendar(), m.format('dddd [om] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [om] LT'), "Today + " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('dddd [om] LT'), "Today + " + i + " days end of day");
}
test.done();
},
"calendar last week" : function(test) {
test.expect(15);
moment.lang('nl');
for (i = 2; i < 7; i++) {
m = moment().subtract({ d: i });
test.equal(m.calendar(), m.format('[afgelopen] dddd [om] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[afgelopen] dddd [om] LT'), "Today - " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('[afgelopen] dddd [om] LT'), "Today - " + i + " days end of day");
}
test.done();
},
"calendar all else" : function(test) {
test.expect(4);
moment.lang('nl');
var weeksAgo = moment().subtract({ w: 1 });
var weeksFromNow = moment().add({ w: 1 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
weeksAgo = moment().subtract({ w: 2 });
weeksFromNow = moment().add({ w: 2 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
test.done();
},
"month abbreviation" : function(test) {
test.expect(2);
moment.lang('nl');
test.equal(moment([2012, 5, 23]).format('D-MMM-YYYY'), '23-jun-2012', 'format month abbreviation surrounded by dashes should not include a dot');
test.equal(moment([2012, 5, 23]).format('D MMM YYYY'), '23 jun. 2012', 'format month abbreviation not surrounded by dashes should include a dot');
test.done();
}
};

View File

@ -0,0 +1,249 @@
var moment = require("../../moment");
/**************************************************
Polish
*************************************************/
exports["lang:pl"] = {
"parse" : function(test) {
test.expect(96);
moment.lang('pl');
var tests = 'styczeń sty_luty lut_marzec mar_kwiecień kwi_maj maj_czerwiec cze_lipiec lip_sierpień sie_wrzesień wrz_październik paź_listopad lis_grudzień gru'.split("_");
var i;
function equalTest(input, mmm, i) {
test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
}
for (i = 0; i < 12; i++) {
tests[i] = tests[i].split(' ');
equalTest(tests[i][0], 'MMM', i);
equalTest(tests[i][1], 'MMM', i);
equalTest(tests[i][0], 'MMMM', i);
equalTest(tests[i][1], 'MMMM', i);
equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
}
test.done();
},
"format" : function(test) {
test.expect(18);
moment.lang('pl');
var a = [
['dddd, MMMM Do YYYY, h:mm:ss a', 'niedziela, luty 14. 2010, 3:25:50 pm'],
['ddd, hA', 'nie, 3PM'],
['M Mo MM MMMM MMM', '2 2. 02 luty lut'],
['YYYY YY', '2010 10'],
['D Do DD', '14 14. 14'],
['d do dddd ddd dd', '0 0. niedziela nie N'],
['DDD DDDo DDDD', '45 45. 045'],
['w wo ww', '8 8. 08'],
['h hh', '3 03'],
['H HH', '15 15'],
['m mm', '25 25'],
['s ss', '50 50'],
['a A', 'pm PM'],
['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45. day of the year'],
['L', '14-02-2010'],
['LL', '14 luty 2010'],
['LLL', '14 luty 2010 15:25'],
['LLLL', 'niedziela, 14 luty 2010 15:25']
],
b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
i;
for (i = 0; i < a.length; i++) {
test.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
}
test.done();
},
"format ordinal" : function(test) {
test.expect(31);
moment.lang('pl');
test.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
test.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
test.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
test.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');
test.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');
test.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');
test.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');
test.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');
test.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');
test.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');
test.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');
test.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');
test.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');
test.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');
test.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');
test.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');
test.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');
test.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');
test.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');
test.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');
test.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');
test.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');
test.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');
test.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');
test.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');
test.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');
test.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');
test.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');
test.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');
test.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');
test.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');
test.done();
},
"format month" : function(test) {
test.expect(12);
moment.lang('pl');
var expected = 'styczeń sty_luty lut_marzec mar_kwiecień kwi_maj maj_czerwiec cze_lipiec lip_sierpień sie_wrzesień wrz_październik paź_listopad lis_grudzień gru'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);
}
test.done();
},
"format week" : function(test) {
test.expect(7);
moment.lang('pl');
var expected = 'niedziela nie N_poniedziałek pon Pn_wtorek wt Wt_środa śr Śr_czwartek czw Cz_piątek pt Pt_sobota sb So'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);
}
test.done();
},
"from" : function(test) {
test.expect(30);
moment.lang('pl');
var start = moment([2007, 1, 28]);
test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "kilka sekund", "44 seconds = a few seconds");
test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "minuta", "45 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "minuta", "89 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minuty", "90 seconds = 2 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minuty", "44 minutes = 44 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "godzina", "45 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "godzina", "89 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 godziny", "90 minutes = 2 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 godzin", "5 hours = 5 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 godzin", "21 hours = 21 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "1 dzień", "22 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "1 dzień", "35 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dni", "36 hours = 2 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "1 dzień", "1 day = a day");
test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dni", "5 days = 5 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dni", "25 days = 25 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "miesiąc", "26 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "miesiąc", "30 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "miesiąc", "45 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 miesiące", "46 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 miesiące", "75 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 miesiące", "76 days = 3 months");
test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "miesiąc", "1 month = a month");
test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 miesięcy", "5 months = 5 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 miesięcy", "344 days = 11 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "rok", "345 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "rok", "547 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 lata", "548 days = 2 years");
test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "rok", "1 year = a year");
test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 lat", "5 years = 5 years");
test.done();
},
"suffix" : function(test) {
test.expect(2);
moment.lang('pl');
test.equal(moment(30000).from(0), "za kilka sekund", "prefix");
test.equal(moment(0).from(30000), "kilka sekund temu", "suffix");
test.done();
},
"now from now" : function(test) {
test.expect(1);
moment.lang('pl');
test.equal(moment().fromNow(), "kilka sekund temu", "now from now should display as in the past");
test.done();
},
"fromNow" : function(test) {
test.expect(3);
moment.lang('pl');
test.equal(moment().add({s:30}).fromNow(), "za kilka sekund", "in a few seconds");
test.equal(moment().add({h:1}).fromNow(), "za godzinę", "in an hour");
test.equal(moment().add({d:5}).fromNow(), "za 5 dni", "in 5 days");
test.done();
},
"calendar day" : function(test) {
test.expect(6);
moment.lang('pl');
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Dziś o 02:00", "today at the same time");
test.equal(moment(a).add({ m: 25 }).calendar(), "Dziś o 02:25", "Now plus 25 min");
test.equal(moment(a).add({ h: 1 }).calendar(), "Dziś o 03:00", "Now plus 1 hour");
test.equal(moment(a).add({ d: 1 }).calendar(), "Jutro o 02:00", "tomorrow at the same time");
test.equal(moment(a).subtract({ h: 1 }).calendar(), "Dziś o 01:00", "Now minus 1 hour");
test.equal(moment(a).subtract({ d: 1 }).calendar(), "Wczoraj o 02:00", "yesterday at the same time");
test.done();
},
"calendar next week" : function(test) {
test.expect(15);
moment.lang('pl');
var i;
var m;
for (i = 2; i < 7; i++) {
m = moment().add({ d: i });
test.equal(m.calendar(), m.format('[W] dddd [o] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[W] dddd [o] LT'), "Today + " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('[W] dddd [o] LT'), "Today + " + i + " days end of day");
}
test.done();
},
"calendar last week" : function(test) {
test.expect(15);
moment.lang('pl');
for (i = 2; i < 7; i++) {
m = moment().subtract({ d: i });
test.equal(m.calendar(), m.format('[W zeszły/łą] dddd [o] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[W zeszły/łą] dddd [o] LT'), "Today - " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('[W zeszły/łą] dddd [o] LT'), "Today - " + i + " days end of day");
}
test.done();
},
"calendar all else" : function(test) {
test.expect(4);
moment.lang('pl');
var weeksAgo = moment().subtract({ w: 1 });
var weeksFromNow = moment().add({ w: 1 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
weeksAgo = moment().subtract({ w: 2 });
weeksFromNow = moment().add({ w: 2 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
test.done();
}
};

View File

@ -0,0 +1,241 @@
var moment = require("../../moment");
/**************************************************
Portuguese - Brazilian
*************************************************/
exports["lang:pt-br"] = {
"parse" : function(test) {
test.expect(96);
moment.lang('pt-br');
var tests = 'Janeiro Jan_Fevereiro Fev_Março Mar_Abril Abr_Maio Mai_Junho Jun_Julho Jul_Agosto Ago_Setembro Set_Outubro Out_Novembro Nov_Dezembro Dez'.split("_");
var i;
function equalTest(input, mmm, i) {
test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
}
for (i = 0; i < 12; i++) {
tests[i] = tests[i].split(' ');
equalTest(tests[i][0], 'MMM', i);
equalTest(tests[i][1], 'MMM', i);
equalTest(tests[i][0], 'MMMM', i);
equalTest(tests[i][1], 'MMMM', i);
equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
}
test.done();
},
"format" : function(test) {
test.expect(18);
moment.lang('pt-br');
var a = [
['dddd, MMMM Do YYYY, h:mm:ss a', 'Domingo, Fevereiro 14º 2010, 3:25:50 pm'],
['ddd, hA', 'Dom, 3PM'],
['M Mo MM MMMM MMM', '2 2º 02 Fevereiro Fev'],
['YYYY YY', '2010 10'],
['D Do DD', '14 14º 14'],
['d do dddd ddd', '0 0º Domingo Dom'],
['DDD DDDo DDDD', '45 45º 045'],
['w wo ww', '8 8º 08'],
['h hh', '3 03'],
['H HH', '15 15'],
['m mm', '25 25'],
['s ss', '50 50'],
['a A', 'pm PM'],
['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45º day of the year'],
['L', '14/02/2010'],
['LL', '14 de Fevereiro de 2010'],
['LLL', '14 de Fevereiro de 2010 15:25'],
['LLLL', 'Domingo, 14 de Fevereiro de 2010 15:25']
],
b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
i;
for (i = 0; i < a.length; i++) {
test.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
}
test.done();
},
"format ordinal" : function(test) {
test.expect(31);
moment.lang('pt-br');
test.equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
test.equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º');
test.equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º');
test.equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º');
test.equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º');
test.equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º');
test.equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º');
test.equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º');
test.equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º');
test.equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º');
test.equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º');
test.equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º');
test.equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º');
test.equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º');
test.equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º');
test.equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º');
test.equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º');
test.equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º');
test.equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º');
test.equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º');
test.equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º');
test.equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º');
test.equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º');
test.equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º');
test.equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º');
test.equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º');
test.equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º');
test.equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º');
test.equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º');
test.equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º');
test.equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º');
test.done();
},
"format month" : function(test) {
test.expect(12);
moment.lang('pt-br');
var expected = 'Janeiro Jan_Fevereiro Fev_Março Mar_Abril Abr_Maio Mai_Junho Jun_Julho Jul_Agosto Ago_Setembro Set_Outubro Out_Novembro Nov_Dezembro Dez'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);
}
test.done();
},
"format week" : function(test) {
test.expect(7);
moment.lang('pt-br');
var expected = 'Domingo Dom_Segunda-feira Seg_Terça-feira Ter_Quarta-feira Qua_Quinta-feira Qui_Sexta-feira Sex_Sábado Sáb'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
}
test.done();
},
"from" : function(test) {
test.expect(30);
moment.lang('pt-br');
var start = moment([2007, 1, 28]);
test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "segundos", "44 seconds = seconds");
test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "um minuto", "45 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "um minuto", "89 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutos", "90 seconds = 2 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutos", "44 minutes = 44 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "uma hora", "45 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "uma hora", "89 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 horas", "90 minutes = 2 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 horas", "5 hours = 5 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 horas", "21 hours = 21 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "um dia", "22 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "um dia", "35 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dias", "36 hours = 2 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "um dia", "1 day = a day");
test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dias", "5 days = 5 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dias", "25 days = 25 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "um mês", "26 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "um mês", "30 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "um mês", "45 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 meses", "46 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 meses", "75 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 meses", "76 days = 3 months");
test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "um mês", "1 month = a month");
test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 meses", "5 months = 5 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 meses", "344 days = 11 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "um ano", "345 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "um ano", "547 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 anos", "548 days = 2 years");
test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "um ano", "1 year = a year");
test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 anos", "5 years = 5 years");
test.done();
},
"suffix" : function(test) {
test.expect(2);
moment.lang('pt-br');
test.equal(moment(30000).from(0), "em segundos", "prefix");
test.equal(moment(0).from(30000), "segundos atrás", "suffix");
test.done();
},
"fromNow" : function(test) {
test.expect(2);
moment.lang('pt-br');
test.equal(moment().add({s:30}).fromNow(), "em segundos", "in seconds");
test.equal(moment().add({d:5}).fromNow(), "em 5 dias", "in 5 days");
test.done();
},
"calendar day" : function(test) {
test.expect(6);
moment.lang('pt-br');
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Hoje às 02:00", "today at the same time");
test.equal(moment(a).add({ m: 25 }).calendar(), "Hoje às 02:25", "Now plus 25 min");
test.equal(moment(a).add({ h: 1 }).calendar(), "Hoje às 03:00", "Now plus 1 hour");
test.equal(moment(a).add({ d: 1 }).calendar(), "Amanhã às 02:00", "tomorrow at the same time");
test.equal(moment(a).subtract({ h: 1 }).calendar(), "Hoje às 01:00", "Now minus 1 hour");
test.equal(moment(a).subtract({ d: 1 }).calendar(), "Ontem às 02:00", "yesterday at the same time");
test.done();
},
"calendar next week" : function(test) {
test.expect(15);
moment.lang('pt-br');
var i;
var m;
for (i = 2; i < 7; i++) {
m = moment().add({ d: i });
test.equal(m.calendar(), m.format('dddd [às] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [às] LT'), "Today + " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('dddd [às] LT'), "Today + " + i + " days end of day");
}
test.done();
},
"calendar last week" : function(test) {
test.expect(15);
moment.lang('pt-br');
for (i = 2; i < 7; i++) {
m = moment().subtract({ d: i });
test.equal(m.calendar(), m.format((m.day() === 0 || m.day() === 6) ? '[Último] dddd [às] LT' : '[Última] dddd [às] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format((m.day() === 0 || m.day() === 6) ? '[Último] dddd [às] LT' : '[Última] dddd [às] LT'), "Today - " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format((m.day() === 0 || m.day() === 6) ? '[Último] dddd [às] LT' : '[Última] dddd [às] LT'), "Today - " + i + " days end of day");
}
test.done();
},
"calendar all else" : function(test) {
test.expect(4);
moment.lang('pt-br');
var weeksAgo = moment().subtract({ w: 1 });
var weeksFromNow = moment().add({ w: 1 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
weeksAgo = moment().subtract({ w: 2 });
weeksFromNow = moment().add({ w: 2 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
test.done();
}
};

View File

@ -0,0 +1,241 @@
var moment = require("../../moment");
/**************************************************
Portuguese
*************************************************/
exports["lang:pt"] = {
"parse" : function(test) {
test.expect(96);
moment.lang('pt');
var tests = 'Janeiro Jan_Fevereiro Fev_Março Mar_Abril Abr_Maio Mai_Junho Jun_Julho Jul_Agosto Ago_Setembro Set_Outubro Out_Novembro Nov_Dezembro Dez'.split("_");
var i;
function equalTest(input, mmm, i) {
test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
}
for (i = 0; i < 12; i++) {
tests[i] = tests[i].split(' ');
equalTest(tests[i][0], 'MMM', i);
equalTest(tests[i][1], 'MMM', i);
equalTest(tests[i][0], 'MMMM', i);
equalTest(tests[i][1], 'MMMM', i);
equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
}
test.done();
},
"format" : function(test) {
test.expect(18);
moment.lang('pt');
var a = [
['dddd, MMMM Do YYYY, h:mm:ss a', 'Domingo, Fevereiro 14º 2010, 3:25:50 pm'],
['ddd, hA', 'Dom, 3PM'],
['M Mo MM MMMM MMM', '2 2º 02 Fevereiro Fev'],
['YYYY YY', '2010 10'],
['D Do DD', '14 14º 14'],
['d do dddd ddd dd', '0 0º Domingo Dom Dom'],
['DDD DDDo DDDD', '45 45º 045'],
['w wo ww', '8 8º 08'],
['h hh', '3 03'],
['H HH', '15 15'],
['m mm', '25 25'],
['s ss', '50 50'],
['a A', 'pm PM'],
['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45º day of the year'],
['L', '14/02/2010'],
['LL', '14 de Fevereiro de 2010'],
['LLL', '14 de Fevereiro de 2010 15:25'],
['LLLL', 'Domingo, 14 de Fevereiro de 2010 15:25']
],
b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
i;
for (i = 0; i < a.length; i++) {
test.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
}
test.done();
},
"format ordinal" : function(test) {
test.expect(31);
moment.lang('pt');
test.equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
test.equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º');
test.equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º');
test.equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º');
test.equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º');
test.equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º');
test.equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º');
test.equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º');
test.equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º');
test.equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º');
test.equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º');
test.equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º');
test.equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º');
test.equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º');
test.equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º');
test.equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º');
test.equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º');
test.equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º');
test.equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º');
test.equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º');
test.equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º');
test.equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º');
test.equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º');
test.equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º');
test.equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º');
test.equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º');
test.equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º');
test.equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º');
test.equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º');
test.equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º');
test.equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º');
test.done();
},
"format month" : function(test) {
test.expect(12);
moment.lang('pt');
var expected = 'Janeiro Jan_Fevereiro Fev_Março Mar_Abril Abr_Maio Mai_Junho Jun_Julho Jul_Agosto Ago_Setembro Set_Outubro Out_Novembro Nov_Dezembro Dez'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);
}
test.done();
},
"format week" : function(test) {
test.expect(7);
moment.lang('pt');
var expected = 'Domingo Dom Dom_Segunda-feira Seg 2ª_Terça-feira Ter 3ª_Quarta-feira Qua 4ª_Quinta-feira Qui 5ª_Sexta-feira Sex 6ª_Sábado Sáb Sáb'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);
}
test.done();
},
"from" : function(test) {
test.expect(30);
moment.lang('pt');
var start = moment([2007, 1, 28]);
test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "segundos", "44 seconds = seconds");
test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "um minuto", "45 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "um minuto", "89 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutos", "90 seconds = 2 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutos", "44 minutes = 44 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "uma hora", "45 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "uma hora", "89 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 horas", "90 minutes = 2 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 horas", "5 hours = 5 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 horas", "21 hours = 21 hours");
test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "um dia", "22 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "um dia", "35 hours = a day");
test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dias", "36 hours = 2 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "um dia", "1 day = a day");
test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dias", "5 days = 5 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dias", "25 days = 25 days");
test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "um mês", "26 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "um mês", "30 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "um mês", "45 days = a month");
test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 meses", "46 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 meses", "75 days = 2 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 meses", "76 days = 3 months");
test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "um mês", "1 month = a month");
test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 meses", "5 months = 5 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 meses", "344 days = 11 months");
test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "um ano", "345 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "um ano", "547 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 anos", "548 days = 2 years");
test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "um ano", "1 year = a year");
test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 anos", "5 years = 5 years");
test.done();
},
"suffix" : function(test) {
test.expect(2);
moment.lang('pt');
test.equal(moment(30000).from(0), "em segundos", "prefix");
test.equal(moment(0).from(30000), "segundos atrás", "suffix");
test.done();
},
"fromNow" : function(test) {
test.expect(2);
moment.lang('pt');
test.equal(moment().add({s:30}).fromNow(), "em segundos", "in seconds");
test.equal(moment().add({d:5}).fromNow(), "em 5 dias", "in 5 days");
test.done();
},
"calendar day" : function(test) {
test.expect(6);
moment.lang('pt');
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Hoje às 02:00", "today at the same time");
test.equal(moment(a).add({ m: 25 }).calendar(), "Hoje às 02:25", "Now plus 25 min");
test.equal(moment(a).add({ h: 1 }).calendar(), "Hoje às 03:00", "Now plus 1 hour");
test.equal(moment(a).add({ d: 1 }).calendar(), "Amanhã às 02:00", "tomorrow at the same time");
test.equal(moment(a).subtract({ h: 1 }).calendar(), "Hoje às 01:00", "Now minus 1 hour");
test.equal(moment(a).subtract({ d: 1 }).calendar(), "Ontem às 02:00", "yesterday at the same time");
test.done();
},
"calendar next week" : function(test) {
test.expect(15);
moment.lang('pt');
var i;
var m;
for (i = 2; i < 7; i++) {
m = moment().add({ d: i });
test.equal(m.calendar(), m.format('dddd [às] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [às] LT'), "Today + " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('dddd [às] LT'), "Today + " + i + " days end of day");
}
test.done();
},
"calendar last week" : function(test) {
test.expect(15);
moment.lang('pt');
for (i = 2; i < 7; i++) {
m = moment().subtract({ d: i });
test.equal(m.calendar(), m.format((m.day() === 0 || m.day() === 6) ? '[Último] dddd [às] LT' : '[Última] dddd [às] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format((m.day() === 0 || m.day() === 6) ? '[Último] dddd [às] LT' : '[Última] dddd [às] LT'), "Today - " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format((m.day() === 0 || m.day() === 6) ? '[Último] dddd [às] LT' : '[Última] dddd [às] LT'), "Today - " + i + " days end of day");
}
test.done();
},
"calendar all else" : function(test) {
test.expect(4);
moment.lang('pt');
var weeksAgo = moment().subtract({ w: 1 });
var weeksFromNow = moment().add({ w: 1 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
weeksAgo = moment().subtract({ w: 2 });
weeksFromNow = moment().add({ w: 2 });
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
test.done();
}
};

Some files were not shown because too many files have changed in this diff Show More