-(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("_"),longDateFormat:{L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},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=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("fr",a)})(),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_Lunedi_Martedi_Mercoledi_Giovedi_Venerdi_Sabato".split("_"),weekdaysShort:"Dom_Lun_Mar_Mer_Gio_Ven_Sab".split("_"),longDateFormat:{L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},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=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("it",a)}(),function(){var a={months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Feb_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("_"),longDateFormat:{L:"DD/MM/YYYY",LL:"D \\de MMMM \\de YYYY",LLL:"D \\de MMMM \\de YYYY HH:mm",LLLL:"dddd, D \\de MMMM \\de YYYY HH:mm"},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=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("pt",a)}(),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("_"),longDateFormat:{L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},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=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("es",a)}(),function(){var a={months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._mei._jun._jul._aug._sep._okt._nov._dec.".split("_"),weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),longDateFormat:{L:"DD-MM-YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"één minuutje",mm:"%d minuten",h:"één uur",hh:"%d uren",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaren"},ordinal:function(a){return a===1||a===8||a>=20?"ste":"de"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("nl",a)}(),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("_"),longDateFormat:{L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm U\\hr",LLLL:"dddd, D. MMMM YYYY HH:mm U\\hr"},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=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("de",a)}(),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("_"),longDateFormat:{L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},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=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("sv",a)}(),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("_"),longDateFormat:{L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},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=c),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("pl",c)}()
\ No newline at end of file
+(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("_"),longDateFormat:{L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm U\\hr",LLLL:"dddd, D. MMMM YYYY HH:mm U\\hr"},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=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("de",a)})(),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("_"),longDateFormat:{L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},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=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("es",a)}(),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("_"),longDateFormat:{L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},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=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("fr",a)}(),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_Lunedi_Martedi_Mercoledi_Giovedi_Venerdi_Sabato".split("_"),weekdaysShort:"Dom_Lun_Mar_Mer_Gio_Ven_Sab".split("_"),longDateFormat:{L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},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=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("it",a)}(),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("_"),longDateFormat:{L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},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=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("nb",a)}(),function(){var a={months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._mei._jun._jul._aug._sep._okt._nov._dec.".split("_"),weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),longDateFormat:{L:"DD-MM-YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"één minuutje",mm:"%d minuten",h:"één uur",hh:"%d uren",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaren"},ordinal:function(a){return a===1||a===8||a>=20?"ste":"de"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("nl",a)}(),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("_"),longDateFormat:{L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},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=c),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("pl",c)}(),function(){var a={months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Feb_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("_"),longDateFormat:{L:"DD/MM/YYYY",LL:"D \\de MMMM \\de YYYY",LLL:"D \\de MMMM \\de YYYY HH:mm",LLLL:"dddd, D \\de MMMM \\de YYYY HH:mm"},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=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("pt",a)}(),function(){var a={months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),weekdaysShort:"вск_пнд_втр_срд_чтв_птн_суб".split("_"),longDateFormat:{L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",m:"минут",mm:"%d минут",h:"часа",hh:"%d часов",d:"1 день",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("ru",a)}(),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("_"),longDateFormat:{L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},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=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("sv",a)}()
\ No newline at end of file
--- /dev/null
+(function(){var a={months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),weekdaysShort:"вск_пнд_втр_срд_чтв_птн_суб".split("_"),longDateFormat:{L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",m:"минут",mm:"%d минут",h:"часа",hh:"%d часов",d:"1 день",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("ru",a)})()
\ No newline at end of file
-<!DOCTYPE html><html><head><meta charset="utf-8"><link href="http://fonts.googleapis.com/css?family=Oswald" rel="stylesheet"><link rel="stylesheet" href="../css/style.css?_=111114_102418"><title>Moment.js Documentation</title></head><body><div id="navwrap"><div id="nav"><h1>Moment.js</h1><ul><li><a href="/" class="btn clean-gray">Home</a></li><li><a href="/docs/" class="btn clean-gray">Documentation</a></li><li><a href="/test/" class="btn clean-gray">Unit Tests</a></li><li><a href="https://github.com/timrwood/moment" class="btn clean-gray">Github</a></li></ul></div></div><div id="content"><div id="docnav"><h2><a href="#/get-it"><span>Get it</span></a></h2><ul><li><a href="#/get-it/github">Github</a></li><li><a href="#/get-it/npm">npm</a></li></ul><h2><a href="#/use-it"><span>Use it</span></a></h2><ul><li><a href="#/use-it/node">In NodeJS</a></li><li><a href="#/use-it/browser">In the browser</a></li></ul><h2><a href="#/parsing"><span>Parsing</span></a></h2><ul><li><a href="#/parsing/date">Javascript Date Object</a></li><li><a href="#/parsing/unix">Unix Timestamp</a></li><li><a href="#/parsing/string">String</a></li><li><a href="#/parsing/string+format">String + Format</a></li><li><a href="#/parsing/string+formats">String + Formats</a></li><li><a href="#/parsing/now">Now</a></li><li><a href="#/parsing/array">Javascript Array</a></li></ul><h2><a href="#/manipulation"><span>Manipulation</span></a></h2><ul><li><a href="#/manipulation/add">Add</a></li><li><a href="#/manipulation/subtract">Subtract</a></li><li><a href="#/manipulation/seconds">Seconds</a></li><li><a href="#/manipulation/minutes">Minutes</a></li><li><a href="#/manipulation/hours">Hours</a></li><li><a href="#/manipulation/date">Date</a></li><li><a href="#/manipulation/month">Month</a></li><li><a href="#/manipulation/year">Year</a></li></ul><h2><a href="#/display"><span>Display</span></a></h2><ul><li><a href="#/display/format">Formatted date</a></li><li><a href="#/display/from">Time from another moment</a></li><li><a href="#/display/fromNow">Time from now</a></li><li><a href="#/display/diff">Difference</a></li><li><a href="#/display/native">Native Date</a></li><li><a href="#/display/valueOf">Value</a></li><li><a href="#/display/seconds">Seconds</a></li><li><a href="#/display/minutes">Minutes</a></li><li><a href="#/display/hours">Hours</a></li><li><a href="#/display/date">Date</a></li><li><a href="#/display/day">Day</a></li><li><a href="#/display/month">Month</a></li><li><a href="#/display/year">Year</a></li><li><a href="#/display/leapyear">Leap Year</a></li></ul><h2><a href="#/i18n"><span>I18N</span></a></h2><ul><li><a href="#/i18n/lang">Changing languages</a></li><li><a href="#/i18n/node">Loading languages in NodeJS</a></li><li><a href="#/i18n/browser">Loading languages in the browser</a></li><li><a href="#/i18n/add">Adding your language to Moment.js</a></li></ul><h2><a href="#/custom"><span>I18N</span></a></h2><ul><li><a href="#/custom/months">Month Names</a></li><li><a href="#/custom/monthsShort">Month Abbreviations</a></li><li><a href="#/custom/weekdays">Weekday Names</a></li><li><a href="#/custom/weekdaysShort">Weekday Abbreviations</a></li><li><a href="#/custom/longDateFormats">Long Date Formats</a></li><li><a href="#/custom/relativeTime">Relative Time</a></li><li><a href="#/custom/ordinal">Ordinal</a></li></ul></div><div id="docs"><h1>Moment.js Documentation</h1><p>A lightweight javascript date library for parsing, manipulating, and formatting dates.</p><a name="/get-it"></a><h2><span>Where to get it</span></h2><a name="/get-it/github"></a><h3><span>Github</span></h3><a href="https://raw.github.com/timrwood/moment/1.1.1/moment.min.js" class="btn cupid-green"><strong>Production </strong><span class="version">Version 1.1.1</span><span class="filesize">2.5kb minified & gzipped</span></a><a href="https://raw.github.com/timrwood/moment/1.1.1/moment.js" class="btn minimal"><strong>Development </strong><span class="version">Version 1.1.1</span><span class="filesize">18kb full source + comments</span></a><p>You can also clone the project with Git by running:</p><pre>git clone git://github.com/timrwood/moment</pre><a name="/get-it/npm"></a><h3><span>npm</span></h3><pre>npm install moment</pre><a name="/use-it"></a><h2><span>Where to use it</span></h2><p>Moment was designed to work in both the browser and in NodeJS. All code will work in both environments. All unit tests are run in both environments.</p><a name="/use-it/node"></a><h3><span>In NodeJS</span></h3><pre>var moment = require('moment');
+<!DOCTYPE html><html><head><meta charset="utf-8"><link href="http://fonts.googleapis.com/css?family=Oswald" rel="stylesheet"><link rel="stylesheet" href="../css/style.css?_=111115_092100"><title>Moment.js Documentation</title></head><body><div id="navwrap"><div id="nav"><h1>Moment.js</h1><ul><li><a href="/" class="btn clean-gray">Home</a></li><li><a href="/docs/" class="btn clean-gray">Documentation</a></li><li><a href="/test/" class="btn clean-gray">Unit Tests</a></li><li><a href="https://github.com/timrwood/moment" class="btn clean-gray">Github</a></li></ul></div></div><div id="content"><div id="docnav"><h2><a href="#/get-it"><span>Get it</span></a></h2><ul><li><a href="#/get-it/github">Github</a></li><li><a href="#/get-it/npm">npm</a></li></ul><h2><a href="#/use-it"><span>Use it</span></a></h2><ul><li><a href="#/use-it/node">In NodeJS</a></li><li><a href="#/use-it/browser">In the browser</a></li></ul><h2><a href="#/parsing"><span>Parsing</span></a></h2><ul><li><a href="#/parsing/date">Javascript Date Object</a></li><li><a href="#/parsing/unix">Unix Timestamp</a></li><li><a href="#/parsing/string">String</a></li><li><a href="#/parsing/string+format">String + Format</a></li><li><a href="#/parsing/string+formats">String + Formats</a></li><li><a href="#/parsing/now">Now</a></li><li><a href="#/parsing/array">Javascript Array</a></li></ul><h2><a href="#/manipulation"><span>Manipulation</span></a></h2><ul><li><a href="#/manipulation/add">Add</a></li><li><a href="#/manipulation/subtract">Subtract</a></li><li><a href="#/manipulation/seconds">Seconds</a></li><li><a href="#/manipulation/minutes">Minutes</a></li><li><a href="#/manipulation/hours">Hours</a></li><li><a href="#/manipulation/date">Date</a></li><li><a href="#/manipulation/month">Month</a></li><li><a href="#/manipulation/year">Year</a></li></ul><h2><a href="#/display"><span>Display</span></a></h2><ul><li><a href="#/display/format">Formatted date</a></li><li><a href="#/display/from">Time from another moment</a></li><li><a href="#/display/fromNow">Time from now</a></li><li><a href="#/display/diff">Difference</a></li><li><a href="#/display/native">Native Date</a></li><li><a href="#/display/valueOf">Value</a></li><li><a href="#/display/seconds">Seconds</a></li><li><a href="#/display/minutes">Minutes</a></li><li><a href="#/display/hours">Hours</a></li><li><a href="#/display/date">Date</a></li><li><a href="#/display/day">Day</a></li><li><a href="#/display/month">Month</a></li><li><a href="#/display/year">Year</a></li><li><a href="#/display/leapyear">Leap Year</a></li></ul><h2><a href="#/i18n"><span>I18N</span></a></h2><ul><li><a href="#/i18n/lang">Changing languages</a></li><li><a href="#/i18n/node">Loading languages in NodeJS</a></li><li><a href="#/i18n/browser">Loading languages in the browser</a></li><li><a href="#/i18n/add">Adding your language to Moment.js</a></li></ul><h2><a href="#/custom"><span>I18N</span></a></h2><ul><li><a href="#/custom/months">Month Names</a></li><li><a href="#/custom/monthsShort">Month Abbreviations</a></li><li><a href="#/custom/weekdays">Weekday Names</a></li><li><a href="#/custom/weekdaysShort">Weekday Abbreviations</a></li><li><a href="#/custom/longDateFormats">Long Date Formats</a></li><li><a href="#/custom/relativeTime">Relative Time</a></li><li><a href="#/custom/ordinal">Ordinal</a></li></ul></div><div id="docs"><h1>Moment.js Documentation</h1><p>A lightweight javascript date library for parsing, manipulating, and formatting dates.</p><a name="/get-it"></a><h2><span>Where to get it</span></h2><a name="/get-it/github"></a><h3><span>Github</span></h3><a href="https://raw.github.com/timrwood/moment/1.1.1/moment.min.js" class="btn cupid-green"><strong>Production </strong><span class="version">Version 1.1.1</span><span class="filesize">2.5kb minified & gzipped</span></a><a href="https://raw.github.com/timrwood/moment/1.1.1/moment.js" class="btn minimal"><strong>Development </strong><span class="version">Version 1.1.1</span><span class="filesize">18kb full source + comments</span></a><p>You can also clone the project with Git by running:</p><pre>git clone git://github.com/timrwood/moment</pre><a name="/get-it/npm"></a><h3><span>npm</span></h3><pre>npm install moment</pre><a name="/use-it"></a><h2><span>Where to use it</span></h2><p>Moment was designed to work in both the browser and in NodeJS. All code will work in both environments. All unit tests are run in both environments.</p><a name="/use-it/node"></a><h3><span>In NodeJS</span></h3><pre>var moment = require('moment');
moment().add('hours', 1).fromNow(); // "1 hour ago"
</pre><a name="/use-it/browser"></a><h3><span>In the browser</span></h3><pre><script src="moment.min.js"></script>
moment().add('hours', 1).fromNow(); // "1 hour ago"
(b === 2) ? 'nd' :
(b === 3) ? 'rd' : 'th';
};
-</pre><p>For more information on ordinal numbers, see <a href="http://en.wikipedia.org/wiki/Ordinal_number_%28linguistics%29">wikipedia</a></p><div class="footer"></div></div></div><script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script><script src="../js/docs.min.js?_=111114_102418"></script><script>window._gaq = [['_setAccount','UA-10641787-5'],['_trackPageview'],['_trackPageLoadTime']];
+</pre><p>For more information on ordinal numbers, see <a href="http://en.wikipedia.org/wiki/Ordinal_number_%28linguistics%29">wikipedia</a></p><div class="footer"></div></div></div><script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script><script src="../js/docs.min.js?_=111115_092100"></script><script>window._gaq = [['_setAccount','UA-10641787-5'],['_trackPageview'],['_trackPageLoadTime']];
(function(d, c) {
var ga = d.createElement(c); ga.async = true;
ga.src = "http://www.google-analytics.com/ga.js";
-<!DOCTYPE html><html><head><meta charset="utf-8"><link href="http://fonts.googleapis.com/css?family=Oswald" rel="stylesheet"><link rel="stylesheet" href="css/style.css?_=111114_102418"><title>Moment.js - A lightweight javascript date library</title></head><body><div id="navwrap"><div id="nav"><h1>Moment.js</h1><ul><li><a href="/" class="btn clean-gray">Home</a></li><li><a href="/docs/" class="btn clean-gray">Documentation</a></li><li><a href="/test/" class="btn clean-gray">Unit Tests</a></li><li><a href="https://github.com/timrwood/moment" class="btn clean-gray">Github</a></li></ul></div></div><div id="content"><div id="home"><h2>Moment.js</h2><h3>A lightweight javascript date library for parsing, manipulating, and formatting dates.</h3><div class="col1"><h4><span>Get it</span></h4><pre>npm install moment</pre><a href="https://raw.github.com/timrwood/moment/1.1.1/moment.min.js" class="btn cupid-green"><strong>Production </strong><span class="version">Version 1.1.1</span><span class="filesize">2.5kb minified & gzipped</span></a><a href="https://raw.github.com/timrwood/moment/1.1.1/moment.js" class="btn minimal"><strong>Development </strong><span class="version">Version 1.1.1</span><span class="filesize">18kb full source + comments</span></a></div><div class="col2"><h4><span>Use it</span></h4><pre class="js">var now = moment();
+<!DOCTYPE html><html><head><meta charset="utf-8"><link href="http://fonts.googleapis.com/css?family=Oswald" rel="stylesheet"><link rel="stylesheet" href="css/style.css?_=111115_092100"><title>Moment.js - A lightweight javascript date library</title></head><body><div id="navwrap"><div id="nav"><h1>Moment.js</h1><ul><li><a href="/" class="btn clean-gray">Home</a></li><li><a href="/docs/" class="btn clean-gray">Documentation</a></li><li><a href="/test/" class="btn clean-gray">Unit Tests</a></li><li><a href="https://github.com/timrwood/moment" class="btn clean-gray">Github</a></li></ul></div></div><div id="content"><div id="home"><h2>Moment.js</h2><h3>A lightweight javascript date library for parsing, manipulating, and formatting dates.</h3><div class="col1"><h4><span>Get it</span></h4><pre>npm install moment</pre><a href="https://raw.github.com/timrwood/moment/1.1.1/moment.min.js" class="btn cupid-green"><strong>Production </strong><span class="version">Version 1.1.1</span><span class="filesize">2.5kb minified & gzipped</span></a><a href="https://raw.github.com/timrwood/moment/1.1.1/moment.js" class="btn minimal"><strong>Development </strong><span class="version">Version 1.1.1</span><span class="filesize">18kb full source + comments</span></a></div><div class="col2"><h4><span>Use it</span></h4><pre class="js">var now = moment();
console.log(now.format('dddd, MMMM Do YYYY, h:mm:ss a'));
</pre><h5><span id="js-format-now"></span></h5><pre class="js">var halloween = moment([2011, 9, 31]); \\ October 31st
console.log(halloween.fromNow());
</pre><h5><span id="js-add"></span></h5><pre class="js">var now = moment();
moment.lang('fr');
console.log(now.format('LLLL'));
-</pre><h5><span id="js-lang"></span></h5></div></div></div><script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script><script src="js/home.min.js?_=111114_102418"></script><script>window._gaq = [['_setAccount','UA-10641787-5'],['_trackPageview'],['_trackPageLoadTime']];
+</pre><h5><span id="js-lang"></span></h5></div></div></div><script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script><script src="js/home.min.js?_=111115_092100"></script><script>window._gaq = [['_setAccount','UA-10641787-5'],['_trackPageview'],['_trackPageLoadTime']];
(function(d, c) {
var ga = d.createElement(c); ga.async = true;
ga.src = "http://www.google-analytics.com/ga.js";
-(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("_"),longDateFormat:{L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},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=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("fr",a)})(),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_Lunedi_Martedi_Mercoledi_Giovedi_Venerdi_Sabato".split("_"),weekdaysShort:"Dom_Lun_Mar_Mer_Gio_Ven_Sab".split("_"),longDateFormat:{L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},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=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("it",a)}(),function(){var a={months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Feb_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("_"),longDateFormat:{L:"DD/MM/YYYY",LL:"D \\de MMMM \\de YYYY",LLL:"D \\de MMMM \\de YYYY HH:mm",LLLL:"dddd, D \\de MMMM \\de YYYY HH:mm"},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=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("pt",a)}(),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("_"),longDateFormat:{L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},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=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("es",a)}(),function(){var a={months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._mei._jun._jul._aug._sep._okt._nov._dec.".split("_"),weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),longDateFormat:{L:"DD-MM-YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"één minuutje",mm:"%d minuten",h:"één uur",hh:"%d uren",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaren"},ordinal:function(a){return a===1||a===8||a>=20?"ste":"de"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("nl",a)}(),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("_"),longDateFormat:{L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm U\\hr",LLLL:"dddd, D. MMMM YYYY HH:mm U\\hr"},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=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("de",a)}(),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("_"),longDateFormat:{L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},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=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("sv",a)}(),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("_"),longDateFormat:{L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},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=c),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("pl",c)}()
\ No newline at end of file
+(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("_"),longDateFormat:{L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm U\\hr",LLLL:"dddd, D. MMMM YYYY HH:mm U\\hr"},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=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("de",a)})(),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("_"),longDateFormat:{L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},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=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("es",a)}(),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("_"),longDateFormat:{L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},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=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("fr",a)}(),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_Lunedi_Martedi_Mercoledi_Giovedi_Venerdi_Sabato".split("_"),weekdaysShort:"Dom_Lun_Mar_Mer_Gio_Ven_Sab".split("_"),longDateFormat:{L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},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=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("it",a)}(),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("_"),longDateFormat:{L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},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=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("nb",a)}(),function(){var a={months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._mei._jun._jul._aug._sep._okt._nov._dec.".split("_"),weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),longDateFormat:{L:"DD-MM-YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"één minuutje",mm:"%d minuten",h:"één uur",hh:"%d uren",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaren"},ordinal:function(a){return a===1||a===8||a>=20?"ste":"de"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("nl",a)}(),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("_"),longDateFormat:{L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},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=c),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("pl",c)}(),function(){var a={months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Feb_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("_"),longDateFormat:{L:"DD/MM/YYYY",LL:"D \\de MMMM \\de YYYY",LLL:"D \\de MMMM \\de YYYY HH:mm",LLLL:"dddd, D \\de MMMM \\de YYYY HH:mm"},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=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("pt",a)}(),function(){var a={months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),weekdaysShort:"вск_пнд_втр_срд_чтв_птн_суб".split("_"),longDateFormat:{L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",m:"минут",mm:"%d минут",h:"часа",hh:"%d часов",d:"1 день",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("ru",a)}(),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("_"),longDateFormat:{L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},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=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("sv",a)}()
\ No newline at end of file
})();
(function() { var moment; if (typeof window === 'undefined') { moment = require('../../moment'); module = QUnit.module; } else { moment = window.moment; }
+/**************************************************
+ German
+ *************************************************/
+
+module("lang:de");
+
+test("format", 18, function() {
+ 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', '0 0. Sonntag 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++) {
+ equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
+ }
+});
+
+test("format ordinal", 31, function() {
+ moment.lang('de');
+ equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
+ equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
+ equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
+ equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');
+ equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');
+ equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');
+ equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');
+ equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');
+ equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');
+ equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');
+
+ equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');
+ equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');
+ equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');
+ equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');
+ equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');
+ equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');
+ equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');
+ equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');
+ equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');
+ equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');
+
+ equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');
+ equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');
+ equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');
+ equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');
+ equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');
+ equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');
+ equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');
+ equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');
+ equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');
+ equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');
+
+ equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');
+});
+
+test("format month", 12, function() {
+ 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++) {
+ equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
+ }
+});
+
+test("format week", 7, function() {
+ moment.lang('de');
+ var expected = 'Sonntag So._Montag Mo._Dienstag Di._Mittwoch Mi._Donnerstag Do._Freitag Fr._Samstag Sa.'.split("_");
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
+ }
+});
+
+test("from", 30, function() {
+ moment.lang('de');
+ var start = moment([2007, 1, 28]);
+ equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "ein paar Sekunden", "44 seconds = a few seconds");
+ equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "einer Minute", "45 seconds = a minute");
+ equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "einer Minute", "89 seconds = a minute");
+ equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 Minuten", "90 seconds = 2 minutes");
+ equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 Minuten", "44 minutes = 44 minutes");
+ equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "einer Stunde", "45 minutes = an hour");
+ equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "einer Stunde", "89 minutes = an hour");
+ equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 Stunden", "90 minutes = 2 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 Stunden", "5 hours = 5 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 Stunden", "21 hours = 21 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "einem Tag", "22 hours = a day");
+ equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "einem Tag", "35 hours = a day");
+ equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 Tagen", "36 hours = 2 days");
+ equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "einem Tag", "1 day = a day");
+ equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 Tagen", "5 days = 5 days");
+ equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 Tagen", "25 days = 25 days");
+ equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "einem Monat", "26 days = a month");
+ equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "einem Monat", "30 days = a month");
+ equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "einem Monat", "45 days = a month");
+ equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 Monaten", "46 days = 2 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 Monaten", "75 days = 2 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 Monaten", "76 days = 3 months");
+ equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "einem Monat", "1 month = a month");
+ equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 Monaten", "5 months = 5 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 Monaten", "344 days = 11 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "einem Jahr", "345 days = a year");
+ equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "einem Jahr", "547 days = a year");
+ equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 Jahren", "548 days = 2 years");
+ equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "einem Jahr", "1 year = a year");
+ equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 Jahren", "5 years = 5 years");
+});
+
+test("suffix", 2, function() {
+ moment.lang('de');
+ equal(moment(30000).from(0), "in ein paar Sekunden", "prefix");
+ equal(moment(0).from(30000), "vor ein paar Sekunden", "suffix");
+});
+
+test("fromNow", 2, function() {
+ moment.lang('de');
+ equal(moment().add({s:30}).fromNow(), "in ein paar Sekunden", "in a few seconds");
+ equal(moment().add({d:5}).fromNow(), "in 5 Tagen", "in 5 days");
+});
+
/**************************************************
English
*************************************************/
/**************************************************
- French
+ Spanish
*************************************************/
-module("lang:fr");
+module("lang:es");
test("format", 18, function() {
- moment.lang('fr');
+ moment.lang('es');
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.'],
+ ['dddd, MMMM Do YYYY, h:mm:ss a', 'Domingo, Febrero 14º 2010, 3:25:50 pm'],
+ ['ddd, hA', 'Dom., 3PM'],
+ ['M Mo MM MMMM MMM', '2 2º 02 Febrero Feb.'],
['YYYY YY', '2010 10'],
- ['D Do DD', '14 14ème 14'],
- ['d do dddd ddd', '0 0ème dimanche dim.'],
- ['DDD DDDo DDDD', '45 45ème 045'],
- ['w wo ww', '8 8ème 08'],
+ ['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ème day of the year'],
+ ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45º 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']
+ ['LL', '14 Febrero 2010'],
+ ['LLL', '14 Febrero 2010 15:25'],
+ ['LLLL', 'Domingo 14 Febrero 2010 15:25']
],
b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
i;
});
test("format ordinal", 31, function() {
- moment.lang('fr');
- equal(moment([2011, 0, 1]).format('DDDo'), '1er', '1er');
- equal(moment([2011, 0, 2]).format('DDDo'), '2ème', '2ème');
- equal(moment([2011, 0, 3]).format('DDDo'), '3ème', '3ème');
- equal(moment([2011, 0, 4]).format('DDDo'), '4ème', '4ème');
- equal(moment([2011, 0, 5]).format('DDDo'), '5ème', '5ème');
- equal(moment([2011, 0, 6]).format('DDDo'), '6ème', '6ème');
- equal(moment([2011, 0, 7]).format('DDDo'), '7ème', '7ème');
- equal(moment([2011, 0, 8]).format('DDDo'), '8ème', '8ème');
- equal(moment([2011, 0, 9]).format('DDDo'), '9ème', '9ème');
- equal(moment([2011, 0, 10]).format('DDDo'), '10ème', '10ème');
+ moment.lang('es');
+ equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
+ equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º');
+ equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º');
+ equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º');
+ equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º');
+ equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º');
+ equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º');
+ equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º');
+ equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º');
+ equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º');
- equal(moment([2011, 0, 11]).format('DDDo'), '11ème', '11ème');
- equal(moment([2011, 0, 12]).format('DDDo'), '12ème', '12ème');
- equal(moment([2011, 0, 13]).format('DDDo'), '13ème', '13ème');
- equal(moment([2011, 0, 14]).format('DDDo'), '14ème', '14ème');
- equal(moment([2011, 0, 15]).format('DDDo'), '15ème', '15ème');
- equal(moment([2011, 0, 16]).format('DDDo'), '16ème', '16ème');
- equal(moment([2011, 0, 17]).format('DDDo'), '17ème', '17ème');
- equal(moment([2011, 0, 18]).format('DDDo'), '18ème', '18ème');
- equal(moment([2011, 0, 19]).format('DDDo'), '19ème', '19ème');
- equal(moment([2011, 0, 20]).format('DDDo'), '20ème', '20ème');
+ equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º');
+ equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º');
+ equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º');
+ equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º');
+ equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º');
+ equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º');
+ equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º');
+ equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º');
+ equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º');
+ equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º');
- equal(moment([2011, 0, 21]).format('DDDo'), '21ème', '21ème');
- equal(moment([2011, 0, 22]).format('DDDo'), '22ème', '22ème');
- equal(moment([2011, 0, 23]).format('DDDo'), '23ème', '23ème');
- equal(moment([2011, 0, 24]).format('DDDo'), '24ème', '24ème');
- equal(moment([2011, 0, 25]).format('DDDo'), '25ème', '25ème');
- equal(moment([2011, 0, 26]).format('DDDo'), '26ème', '26ème');
- equal(moment([2011, 0, 27]).format('DDDo'), '27ème', '27ème');
- equal(moment([2011, 0, 28]).format('DDDo'), '28ème', '28ème');
- equal(moment([2011, 0, 29]).format('DDDo'), '29ème', '29ème');
- equal(moment([2011, 0, 30]).format('DDDo'), '30ème', '30ème');
+ equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º');
+ equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º');
+ equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º');
+ equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º');
+ equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º');
+ equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º');
+ equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º');
+ equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º');
+ equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º');
+ equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º');
- equal(moment([2011, 0, 31]).format('DDDo'), '31ème', '31ème');
+ equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º');
});
test("format month", 12, function() {
- 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("_");
+ 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++) {
equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
});
test("format week", 7, function() {
- moment.lang('fr');
- var expected = 'dimanche dim._lundi lun._mardi mar._mercredi mer._jeudi jeu._vendredi ven._samedi sam.'.split("_");
+ moment.lang('es');
+ var expected = 'Domingo Dom._Lunes Lun._Martes Mar._Miércoles Mié._Jueves Jue._Viernes Vie._Sábado Sáb.'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
});
test("from", 30, function() {
- moment.lang('fr');
+ moment.lang('es');
var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "quelques secondes", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "une minute", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "une minute", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutes", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutes", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "une heure", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "une heure", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 heures", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 heures", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 heures", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "un jour", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "un jour", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 jours", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "un jour", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 jours", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 jours", "25 days = 25 days");
+ equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "unos segundos", "44 seconds = a few seconds");
+ equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "un minuto", "45 seconds = a minute");
+ equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "un minuto", "89 seconds = a minute");
+ equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutos", "90 seconds = 2 minutes");
+ equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutos", "44 minutes = 44 minutes");
+ equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "una hora", "45 minutes = an hour");
+ equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "una hora", "89 minutes = an hour");
+ equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 horas", "90 minutes = 2 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 horas", "5 hours = 5 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 horas", "21 hours = 21 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "un día", "22 hours = a day");
+ equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "un día", "35 hours = a day");
+ equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 días", "36 hours = 2 days");
+ equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "un día", "1 day = a day");
+ equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 días", "5 days = 5 days");
+ equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 días", "25 days = 25 days");
+ equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "un mes", "26 days = a month");
+ equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "un mes", "30 days = a month");
+ equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "un mes", "45 days = a month");
+ equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 meses", "46 days = 2 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 meses", "75 days = 2 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 meses", "76 days = 3 months");
+ equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "un mes", "1 month = a month");
+ equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 meses", "5 months = 5 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 meses", "344 days = 11 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "un año", "345 days = a year");
+ equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "un año", "547 days = a year");
+ equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 años", "548 days = 2 years");
+ equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "un año", "1 year = a year");
+ equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 años", "5 years = 5 years");
+});
+
+test("suffix", 2, function() {
+ moment.lang('es');
+ equal(moment(30000).from(0), "en unos segundos", "prefix");
+ equal(moment(0).from(30000), "hace unos segundos", "suffix");
+});
+
+
+test("now from now", 1, function() {
+ moment.lang('es');
+ equal(moment().fromNow(), "hace unos segundos", "now from now should display as in the past");
+});
+
+
+test("fromNow", 2, function() {
+ moment.lang('es');
+ equal(moment().add({s:30}).fromNow(), "en unos segundos", "en unos segundos");
+ equal(moment().add({d:5}).fromNow(), "en 5 días", "en 5 días");
+});
+
+
+/**************************************************
+ French
+ *************************************************/
+
+module("lang:fr");
+
+test("format", 18, function() {
+ 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', '0 0ème dimanche dim.'],
+ ['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++) {
+ equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
+ }
+});
+
+test("format ordinal", 31, function() {
+ moment.lang('fr');
+ equal(moment([2011, 0, 1]).format('DDDo'), '1er', '1er');
+ equal(moment([2011, 0, 2]).format('DDDo'), '2ème', '2ème');
+ equal(moment([2011, 0, 3]).format('DDDo'), '3ème', '3ème');
+ equal(moment([2011, 0, 4]).format('DDDo'), '4ème', '4ème');
+ equal(moment([2011, 0, 5]).format('DDDo'), '5ème', '5ème');
+ equal(moment([2011, 0, 6]).format('DDDo'), '6ème', '6ème');
+ equal(moment([2011, 0, 7]).format('DDDo'), '7ème', '7ème');
+ equal(moment([2011, 0, 8]).format('DDDo'), '8ème', '8ème');
+ equal(moment([2011, 0, 9]).format('DDDo'), '9ème', '9ème');
+ equal(moment([2011, 0, 10]).format('DDDo'), '10ème', '10ème');
+
+ equal(moment([2011, 0, 11]).format('DDDo'), '11ème', '11ème');
+ equal(moment([2011, 0, 12]).format('DDDo'), '12ème', '12ème');
+ equal(moment([2011, 0, 13]).format('DDDo'), '13ème', '13ème');
+ equal(moment([2011, 0, 14]).format('DDDo'), '14ème', '14ème');
+ equal(moment([2011, 0, 15]).format('DDDo'), '15ème', '15ème');
+ equal(moment([2011, 0, 16]).format('DDDo'), '16ème', '16ème');
+ equal(moment([2011, 0, 17]).format('DDDo'), '17ème', '17ème');
+ equal(moment([2011, 0, 18]).format('DDDo'), '18ème', '18ème');
+ equal(moment([2011, 0, 19]).format('DDDo'), '19ème', '19ème');
+ equal(moment([2011, 0, 20]).format('DDDo'), '20ème', '20ème');
+
+ equal(moment([2011, 0, 21]).format('DDDo'), '21ème', '21ème');
+ equal(moment([2011, 0, 22]).format('DDDo'), '22ème', '22ème');
+ equal(moment([2011, 0, 23]).format('DDDo'), '23ème', '23ème');
+ equal(moment([2011, 0, 24]).format('DDDo'), '24ème', '24ème');
+ equal(moment([2011, 0, 25]).format('DDDo'), '25ème', '25ème');
+ equal(moment([2011, 0, 26]).format('DDDo'), '26ème', '26ème');
+ equal(moment([2011, 0, 27]).format('DDDo'), '27ème', '27ème');
+ equal(moment([2011, 0, 28]).format('DDDo'), '28ème', '28ème');
+ equal(moment([2011, 0, 29]).format('DDDo'), '29ème', '29ème');
+ equal(moment([2011, 0, 30]).format('DDDo'), '30ème', '30ème');
+
+ equal(moment([2011, 0, 31]).format('DDDo'), '31ème', '31ème');
+});
+
+test("format month", 12, function() {
+ 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++) {
+ equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
+ }
+});
+
+test("format week", 7, function() {
+ moment.lang('fr');
+ var expected = 'dimanche dim._lundi lun._mardi mar._mercredi mer._jeudi jeu._vendredi ven._samedi sam.'.split("_");
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
+ }
+});
+
+test("from", 30, function() {
+ moment.lang('fr');
+ var start = moment([2007, 1, 28]);
+ equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "quelques secondes", "44 seconds = a few seconds");
+ equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "une minute", "45 seconds = a minute");
+ equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "une minute", "89 seconds = a minute");
+ equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutes", "90 seconds = 2 minutes");
+ equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutes", "44 minutes = 44 minutes");
+ equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "une heure", "45 minutes = an hour");
+ equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "une heure", "89 minutes = an hour");
+ equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 heures", "90 minutes = 2 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 heures", "5 hours = 5 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 heures", "21 hours = 21 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "un jour", "22 hours = a day");
+ equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "un jour", "35 hours = a day");
+ equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 jours", "36 hours = 2 days");
+ equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "un jour", "1 day = a day");
+ equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 jours", "5 days = 5 days");
+ equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 jours", "25 days = 25 days");
equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "un mois", "26 days = a month");
equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "un mois", "30 days = a month");
equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "un mois", "45 days = a month");
});
/**************************************************
- Portuguese
+ Norwegian bokmål
*************************************************/
-module("lang:pt");
+module("lang:nb");
test("format", 18, function() {
- moment.lang('pt');
+ moment.lang('nb');
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 Feb'],
+ ['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', '0 0º Domingo Dom'],
- ['DDD DDDo DDDD', '45 45º 045'],
- ['w wo ww', '8 8º 08'],
+ ['D Do DD', '14 14. 14'],
+ ['d do dddd ddd', '0 0. søndag sø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 de Fevereiro de 2010'],
- ['LLL', '14 de Fevereiro de 2010 15:25'],
- ['LLLL', 'Domingo, 14 de Fevereiro de 2010 15:25']
+ ['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;
});
test("format ordinal", 31, function() {
- moment.lang('pt');
- equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
- equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º');
- equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º');
- equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º');
- equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º');
- equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º');
- equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º');
- equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º');
- equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º');
- equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º');
+ moment.lang('nb');
+ equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
+ equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
+ equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
+ equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');
+ equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');
+ equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');
+ equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');
+ equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');
+ equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');
+ equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');
- equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º');
- equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º');
- equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º');
- equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º');
- equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º');
- equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º');
- equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º');
- equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º');
- equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º');
- equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º');
+ equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');
+ equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');
+ equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');
+ equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');
+ equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');
+ equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');
+ equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');
+ equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');
+ equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');
+ equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');
- equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º');
- equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º');
- equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º');
- equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º');
- equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º');
- equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º');
- equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º');
- equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º');
- equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º');
- equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º');
+ equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');
+ equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');
+ equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');
+ equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');
+ equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');
+ equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');
+ equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');
+ equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');
+ equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');
+ equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');
- equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º');
+ equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');
});
test("format month", 12, function() {
- moment.lang('pt');
- var expected = 'Janeiro Jan_Fevereiro Feb_Março Mar_Abril Abr_Maio Mai_Junho Jun_Julho Jul_Agosto Ago_Setembro Set_Outubro Out_Novembro Nov_Dezembro Dez'.split("_");
+ 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++) {
equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
});
test("format week", 7, function() {
- moment.lang('pt');
- 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("_");
+ moment.lang('nb');
+ var expected = 'søndag søn_mandag man_tirsdag tir_onsdag ons_torsdag tor_fredag fre_lørdag lør'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
});
test("from", 30, function() {
- moment.lang('pt');
+ moment.lang('nb');
var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "segundos", "44 seconds = seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "um minuto", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "um minuto", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutos", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutos", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "uma hora", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "uma hora", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 horas", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 horas", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 horas", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "um dia", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "um dia", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dias", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "um dia", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dias", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dias", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "um mês", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "um mês", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "um mês", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 meses", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 meses", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 meses", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "um mês", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 meses", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 meses", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "um ano", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "um ano", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 anos", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "um ano", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 anos", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('pt');
- equal(moment(30000).from(0), "em segundos", "prefix");
- equal(moment(0).from(30000), "segundos atrás", "suffix");
-});
-
-test("fromNow", 2, function() {
- moment.lang('pt');
- equal(moment().add({s:30}).fromNow(), "em segundos", "in seconds");
- equal(moment().add({d:5}).fromNow(), "em 5 dias", "in 5 days");
-});
-
-/**************************************************
- Spanish
- *************************************************/
-
-module("lang:es");
-
-test("format", 18, function() {
- moment.lang('es');
- var a = [
- ['dddd, MMMM Do YYYY, h:mm:ss a', 'Domingo, Febrero 14º 2010, 3:25:50 pm'],
- ['ddd, hA', 'Dom., 3PM'],
- ['M Mo MM MMMM MMM', '2 2º 02 Febrero Feb.'],
- ['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 Febrero 2010'],
- ['LLL', '14 Febrero 2010 15:25'],
- ['LLLL', 'Domingo 14 Febrero 2010 15:25']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('es');
- equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
- equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º');
- equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º');
- equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º');
- equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º');
- equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º');
- equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º');
- equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º');
- equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º');
- equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º');
- equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º');
- equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º');
- equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º');
- equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º');
- equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º');
- equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º');
- equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º');
- equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º');
- equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º');
- equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º');
- equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º');
- equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º');
- equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º');
- equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º');
- equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º');
- equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º');
- equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º');
- equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º');
-});
-
-test("format month", 12, function() {
- 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++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('es');
- var expected = 'Domingo Dom._Lunes Lun._Martes Mar._Miércoles Mié._Jueves Jue._Viernes Vie._Sábado Sáb.'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('es');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "unos segundos", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "un minuto", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "un minuto", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutos", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutos", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "una hora", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "una hora", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 horas", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 horas", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 horas", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "un día", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "un día", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 días", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "un día", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 días", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 días", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "un mes", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "un mes", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "un mes", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 meses", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 meses", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 meses", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "un mes", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 meses", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 meses", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "un año", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "un año", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 años", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "un año", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 años", "5 years = 5 years");
+ equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "noen sekunder", "44 sekunder = a few seconds");
+ equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "ett minutt", "45 seconds = a minute");
+ equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "ett minutt", "89 seconds = a minute");
+ equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutter", "90 seconds = 2 minutes");
+ equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutter", "44 minutes = 44 minutes");
+ equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "en time", "45 minutes = an hour");
+ equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "en time", "89 minutes = an hour");
+ equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 timer", "90 minutes = 2 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 timer", "5 hours = 5 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 timer", "21 hours = 21 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "en dag", "22 hours = a day");
+ equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "en dag", "35 hours = a day");
+ equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dager", "36 hours = 2 days");
+ equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "en dag", "1 day = a day");
+ equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dager", "5 days = 5 days");
+ equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dager", "25 days = 25 days");
+ equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "en måned", "26 days = a month");
+ equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "en måned", "30 days = a month");
+ equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "en måned", "45 days = a month");
+ equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 måneder", "46 days = 2 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 måneder", "75 days = 2 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 måneder", "76 days = 3 months");
+ equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "en måned", "1 month = a month");
+ equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 måneder", "5 months = 5 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 måneder", "344 days = 11 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "ett år", "345 days = a year");
+ equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "ett år", "547 days = a year");
+ equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 år", "548 days = 2 years");
+ equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "ett år", "1 year = a year");
+ equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 år", "5 years = 5 years");
});
test("suffix", 2, function() {
- moment.lang('es');
- equal(moment(30000).from(0), "en unos segundos", "prefix");
- equal(moment(0).from(30000), "hace unos segundos", "suffix");
+ moment.lang('nb');
+ equal(moment(30000).from(0), "om noen sekunder", "prefix");
+ equal(moment(0).from(30000), "for noen sekunder siden", "suffix");
});
test("now from now", 1, function() {
- moment.lang('es');
- equal(moment().fromNow(), "hace unos segundos", "now from now should display as in the past");
+ moment.lang('nb');
+ equal(moment().fromNow(), "for noen sekunder siden", "now from now should display as in the past");
});
test("fromNow", 2, function() {
- moment.lang('es');
- equal(moment().add({s:30}).fromNow(), "en unos segundos", "en unos segundos");
- equal(moment().add({d:5}).fromNow(), "en 5 días", "en 5 días");
+ moment.lang('nb');
+ equal(moment().add({s:30}).fromNow(), "om noen sekunder", "in a few seconds");
+ equal(moment().add({d:5}).fromNow(), "om 5 dager", "in 5 days");
});
equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 jaren", "5 years = 5 years");
});
-test("suffix", 2, function() {
- moment.lang('nl');
- equal(moment(30000).from(0), "over een paar seconden", "prefix");
- equal(moment(0).from(30000), "een paar seconden geleden", "suffix");
+test("suffix", 2, function() {
+ moment.lang('nl');
+ equal(moment(30000).from(0), "over een paar seconden", "prefix");
+ equal(moment(0).from(30000), "een paar seconden geleden", "suffix");
+});
+
+
+test("now from now", 1, function() {
+ moment.lang('nl');
+ equal(moment().fromNow(), "een paar seconden geleden", "now from now should display as in the past");
+});
+
+
+test("fromNow", 2, function() {
+ moment.lang('nl');
+ equal(moment().add({s:30}).fromNow(), "over een paar seconden", "in a few seconds");
+ equal(moment().add({d:5}).fromNow(), "over 5 dagen", "in 5 days");
+});
+
+
+/**************************************************
+ Polish
+ *************************************************/
+
+module("lang:pl");
+
+test("format", 18, function() {
+ 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', '0 0. niedziela nie'],
+ ['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++) {
+ equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
+ }
+});
+
+test("format ordinal", 31, function() {
+ moment.lang('pl');
+ equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
+ equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
+ equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
+ equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');
+ equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');
+ equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');
+ equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');
+ equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');
+ equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');
+ equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');
+
+ equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');
+ equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');
+ equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');
+ equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');
+ equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');
+ equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');
+ equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');
+ equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');
+ equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');
+ equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');
+
+ equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');
+ equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');
+ equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');
+ equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');
+ equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');
+ equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');
+ equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');
+ equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');
+ equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');
+ equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');
+
+ equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');
+});
+
+test("format month", 12, function() {
+ 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++) {
+ equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
+ }
+});
+
+test("format week", 7, function() {
+ moment.lang('pl');
+ var expected = 'niedziela nie_poniedziałek pon_wtorek wt_środa śr_czwartek czw_piątek pt_sobota sb'.split("_");
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
+ }
+});
+
+test("from", 30, function() {
+ moment.lang('pl');
+ var start = moment([2007, 1, 28]);
+ equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "kilka sekund", "44 seconds = a few seconds");
+ equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "minuta", "45 seconds = a minute");
+ equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "minuta", "89 seconds = a minute");
+ equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minuty", "90 seconds = 2 minutes");
+ equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minuty", "44 minutes = 44 minutes");
+ equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "godzina", "45 minutes = an hour");
+ equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "godzina", "89 minutes = an hour");
+ equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 godziny", "90 minutes = 2 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 godzin", "5 hours = 5 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 godzin", "21 hours = 21 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "1 dzień", "22 hours = a day");
+ equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "1 dzień", "35 hours = a day");
+ equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dni", "36 hours = 2 days");
+ equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "1 dzień", "1 day = a day");
+ equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dni", "5 days = 5 days");
+ equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dni", "25 days = 25 days");
+ equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "miesiąc", "26 days = a month");
+ equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "miesiąc", "30 days = a month");
+ equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "miesiąc", "45 days = a month");
+ equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 miesiące", "46 days = 2 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 miesiące", "75 days = 2 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 miesiące", "76 days = 3 months");
+ equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "miesiąc", "1 month = a month");
+ equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 miesięcy", "5 months = 5 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 miesięcy", "344 days = 11 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "rok", "345 days = a year");
+ equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "rok", "547 days = a year");
+ equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 lata", "548 days = 2 years");
+ equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "rok", "1 year = a year");
+ equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 lat", "5 years = 5 years");
+});
+
+test("suffix", 2, function() {
+ moment.lang('pl');
+ equal(moment(30000).from(0), "za kilka sekund", "prefix");
+ equal(moment(0).from(30000), "kilka sekund temu", "suffix");
+});
+
+
+test("now from now", 1, function() {
+ moment.lang('pl');
+ equal(moment().fromNow(), "kilka sekund temu", "now from now should display as in the past");
+});
+
+
+test("fromNow", 3, function() {
+ moment.lang('pl');
+ equal(moment().add({s:30}).fromNow(), "za kilka sekund", "in a few seconds");
+ equal(moment().add({h:1}).fromNow(), "za godzinę", "in an hour");
+ equal(moment().add({d:5}).fromNow(), "za 5 dni", "in 5 days");
+});
+
+
+/**************************************************
+ Portuguese
+ *************************************************/
+
+module("lang:pt");
+
+test("format", 18, function() {
+ 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 Feb'],
+ ['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++) {
+ equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
+ }
+});
+
+test("format ordinal", 31, function() {
+ moment.lang('pt');
+ equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
+ equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º');
+ equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º');
+ equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º');
+ equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º');
+ equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º');
+ equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º');
+ equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º');
+ equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º');
+ equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º');
+
+ equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º');
+ equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º');
+ equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º');
+ equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º');
+ equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º');
+ equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º');
+ equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º');
+ equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º');
+ equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º');
+ equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º');
+
+ equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º');
+ equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º');
+ equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º');
+ equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º');
+ equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º');
+ equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º');
+ equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º');
+ equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º');
+ equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º');
+ equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º');
+
+ equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º');
+});
+
+test("format month", 12, function() {
+ moment.lang('pt');
+ var expected = 'Janeiro Jan_Fevereiro Feb_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++) {
+ equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
+ }
+});
+
+test("format week", 7, function() {
+ moment.lang('pt');
+ 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++) {
+ equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
+ }
+});
+
+test("from", 30, function() {
+ moment.lang('pt');
+ var start = moment([2007, 1, 28]);
+ equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "segundos", "44 seconds = seconds");
+ equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "um minuto", "45 seconds = a minute");
+ equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "um minuto", "89 seconds = a minute");
+ equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutos", "90 seconds = 2 minutes");
+ equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutos", "44 minutes = 44 minutes");
+ equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "uma hora", "45 minutes = an hour");
+ equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "uma hora", "89 minutes = an hour");
+ equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 horas", "90 minutes = 2 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 horas", "5 hours = 5 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 horas", "21 hours = 21 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "um dia", "22 hours = a day");
+ equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "um dia", "35 hours = a day");
+ equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dias", "36 hours = 2 days");
+ equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "um dia", "1 day = a day");
+ equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dias", "5 days = 5 days");
+ equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dias", "25 days = 25 days");
+ equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "um mês", "26 days = a month");
+ equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "um mês", "30 days = a month");
+ equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "um mês", "45 days = a month");
+ equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 meses", "46 days = 2 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 meses", "75 days = 2 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 meses", "76 days = 3 months");
+ equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "um mês", "1 month = a month");
+ equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 meses", "5 months = 5 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 meses", "344 days = 11 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "um ano", "345 days = a year");
+ equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "um ano", "547 days = a year");
+ equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 anos", "548 days = 2 years");
+ equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "um ano", "1 year = a year");
+ equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 anos", "5 years = 5 years");
});
-
-test("now from now", 1, function() {
- moment.lang('nl');
- equal(moment().fromNow(), "een paar seconden geleden", "now from now should display as in the past");
+test("suffix", 2, function() {
+ moment.lang('pt');
+ equal(moment(30000).from(0), "em segundos", "prefix");
+ equal(moment(0).from(30000), "segundos atrás", "suffix");
});
-
test("fromNow", 2, function() {
- moment.lang('nl');
- equal(moment().add({s:30}).fromNow(), "over een paar seconden", "in a few seconds");
- equal(moment().add({d:5}).fromNow(), "over 5 dagen", "in 5 days");
+ moment.lang('pt');
+ equal(moment().add({s:30}).fromNow(), "em segundos", "in seconds");
+ equal(moment().add({d:5}).fromNow(), "em 5 dias", "in 5 days");
});
-
/**************************************************
- German
+ Russian
*************************************************/
-module("lang:de");
+module("lang:ru");
test("format", 18, function() {
- moment.lang('de');
+ moment.lang('ru');
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.'],
+ ['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', '0 0. Sonntag So.'],
+ ['d do dddd ddd', '0 0. воскресенье вск'],
['DDD DDDo DDDD', '45 45. 045'],
['w wo ww', '8 8. 08'],
['h hh', '3 03'],
['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']
+ ['L', '14-02-2010'],
+ ['LL', '14 февраль 2010'],
+ ['LLL', '14 февраль 2010 15:25'],
+ ['LLLL', 'воскресенье, 14 февраль 2010 15:25']
],
b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
i;
});
test("format ordinal", 31, function() {
- moment.lang('de');
+ moment.lang('ru');
equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
});
test("format month", 12, function() {
- 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("_");
+ moment.lang('ru');
+ var expected = 'январь янв_февраль фев_март мар_апрель апр_май май_июнь июн_июль июл_август авг_сентябрь сен_октябрь окт_ноябрь ноя_декабрь дек'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
});
test("format week", 7, function() {
- moment.lang('de');
- var expected = 'Sonntag So._Montag Mo._Dienstag Di._Mittwoch Mi._Donnerstag Do._Freitag Fr._Samstag Sa.'.split("_");
+ moment.lang('ru');
+ var expected = 'воскресенье вск_понедельник пнд_вторник втр_среда срд_четверг чтв_пятница птн_суббота суб'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
});
test("from", 30, function() {
- moment.lang('de');
+ moment.lang('ru');
var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "ein paar Sekunden", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "einer Minute", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "einer Minute", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 Minuten", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 Minuten", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "einer Stunde", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "einer Stunde", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 Stunden", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 Stunden", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 Stunden", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "einem Tag", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "einem Tag", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 Tagen", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "einem Tag", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 Tagen", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 Tagen", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "einem Monat", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "einem Monat", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "einem Monat", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 Monaten", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 Monaten", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 Monaten", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "einem Monat", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 Monaten", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 Monaten", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "einem Jahr", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "einem Jahr", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 Jahren", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "einem Jahr", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 Jahren", "5 years = 5 years");
+ equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "несколько секунд", "44 seconds = seconds");
+ equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "минут", "45 seconds = a minute");
+ equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "минут", "89 seconds = a minute");
+ equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 минут", "90 seconds = 2 minutes");
+ equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 минут", "44 minutes = 44 minutes");
+ equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "часа", "45 minutes = an hour");
+ equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "часа", "89 minutes = an hour");
+ equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 часов", "90 minutes = 2 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 часов", "5 hours = 5 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 часов", "21 hours = 21 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "1 день", "22 hours = a day");
+ equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "1 день", "35 hours = a day");
+ equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 дней", "36 hours = 2 days");
+ equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "1 день", "1 day = a day");
+ equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 дней", "5 days = 5 days");
+ equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 дней", "25 days = 25 days");
+ equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "месяц", "26 days = a month");
+ equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "месяц", "30 days = a month");
+ equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "месяц", "45 days = a month");
+ equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 месяцев", "46 days = 2 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 месяцев", "75 days = 2 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 месяцев", "76 days = 3 months");
+ equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "месяц", "1 month = a month");
+ equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 месяцев", "5 months = 5 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 месяцев", "344 days = 11 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "год", "345 days = a year");
+ equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "год", "547 days = a year");
+ equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 лет", "548 days = 2 years");
+ equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "год", "1 year = a year");
+ equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 лет", "5 years = 5 years");
});
test("suffix", 2, function() {
- moment.lang('de');
- equal(moment(30000).from(0), "in ein paar Sekunden", "prefix");
- equal(moment(0).from(30000), "vor ein paar Sekunden", "suffix");
+ moment.lang('ru');
+ equal(moment(30000).from(0), "через несколько секунд", "prefix");
+ equal(moment(0).from(30000), "несколько секунд назад", "suffix");
});
test("fromNow", 2, function() {
- moment.lang('de');
- equal(moment().add({s:30}).fromNow(), "in ein paar Sekunden", "in a few seconds");
- equal(moment().add({d:5}).fromNow(), "in 5 Tagen", "in 5 days");
+ moment.lang('ru');
+ equal(moment().add({s:30}).fromNow(), "через несколько секунд", "in seconds");
+ equal(moment().add({d:5}).fromNow(), "через 5 дней", "in 5 days");
});
/**************************************************
equal(moment().add({d:5}).fromNow(), "om 5 dagar", "in 5 days");
});
-
-/**************************************************
- Polish
- *************************************************/
-
-module("lang:pl");
-
-test("format", 18, function() {
- 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', '0 0. niedziela nie'],
- ['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++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('pl');
- equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
- equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
- equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
- equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');
- equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');
- equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');
- equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');
- equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');
- equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');
- equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');
- equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');
- equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');
- equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');
- equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');
- equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');
- equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');
- equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');
- equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');
- equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');
- equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');
- equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');
- equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');
- equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');
- equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');
- equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');
- equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');
- equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');
- equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');
-});
-
-test("format month", 12, function() {
- 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++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('pl');
- var expected = 'niedziela nie_poniedziałek pon_wtorek wt_środa śr_czwartek czw_piątek pt_sobota sb'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('pl');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "kilka sekund", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "minuta", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "minuta", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minuty", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minuty", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "godzina", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "godzina", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 godziny", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 godzin", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 godzin", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "1 dzień", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "1 dzień", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dni", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "1 dzień", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dni", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dni", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "miesiąc", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "miesiąc", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "miesiąc", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 miesiące", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 miesiące", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 miesiące", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "miesiąc", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 miesięcy", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 miesięcy", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "rok", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "rok", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 lata", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "rok", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 lat", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('pl');
- equal(moment(30000).from(0), "za kilka sekund", "prefix");
- equal(moment(0).from(30000), "kilka sekund temu", "suffix");
-});
-
-
-test("now from now", 1, function() {
- moment.lang('pl');
- equal(moment().fromNow(), "kilka sekund temu", "now from now should display as in the past");
-});
-
-
-test("fromNow", 3, function() {
- moment.lang('pl');
- equal(moment().add({s:30}).fromNow(), "za kilka sekund", "in a few seconds");
- equal(moment().add({h:1}).fromNow(), "za godzinę", "in an hour");
- equal(moment().add({d:5}).fromNow(), "za 5 dni", "in 5 days");
-});
-
})();
\ No newline at end of file
-<!DOCTYPE html><html><head><meta charset="utf-8"><link href="http://fonts.googleapis.com/css?family=Oswald" rel="stylesheet"><link rel="stylesheet" href="../css/style.css?_=111114_102418"><title>Moment.js Unit Test Suite</title></head><body><div id="navwrap"><div id="nav"><h1>Moment.js</h1><ul><li><a href="/" class="btn clean-gray">Home</a></li><li><a href="/docs/" class="btn clean-gray">Documentation</a></li><li><a href="/test/" class="btn clean-gray">Unit Tests</a></li><li><a href="https://github.com/timrwood/moment" class="btn clean-gray">Github</a></li></ul></div></div><div id="content"><div id="test"><h1>Moment.js unit test suite</h1><h2 id="qunit-banner"></h2><h4 id="qunit-userAgent"></h4><ol id="qunit-tests"></ol></div></div><script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script><script src="../js/moment.min.js?_=111114_102418"></script><script src="../js/lang-all.min.js?_=111114_102418"></script><script src="../js/test.min.js?_=111114_102418"></script><script>window._gaq = [['_setAccount','UA-10641787-5'],['_trackPageview'],['_trackPageLoadTime']];
+<!DOCTYPE html><html><head><meta charset="utf-8"><link href="http://fonts.googleapis.com/css?family=Oswald" rel="stylesheet"><link rel="stylesheet" href="../css/style.css?_=111115_092100"><title>Moment.js Unit Test Suite</title></head><body><div id="navwrap"><div id="nav"><h1>Moment.js</h1><ul><li><a href="/" class="btn clean-gray">Home</a></li><li><a href="/docs/" class="btn clean-gray">Documentation</a></li><li><a href="/test/" class="btn clean-gray">Unit Tests</a></li><li><a href="https://github.com/timrwood/moment" class="btn clean-gray">Github</a></li></ul></div></div><div id="content"><div id="test"><h1>Moment.js unit test suite</h1><h2 id="qunit-banner"></h2><h4 id="qunit-userAgent"></h4><ol id="qunit-tests"></ol></div></div><script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script><script src="../js/moment.min.js?_=111115_092100"></script><script src="../js/lang-all.min.js?_=111115_092100"></script><script src="../js/test.min.js?_=111115_092100"></script><script>window._gaq = [['_setAccount','UA-10641787-5'],['_trackPageview'],['_trackPageLoadTime']];
(function(d, c) {
var ga = d.createElement(c); ga.async = true;
ga.src = "http://www.google-analytics.com/ga.js";
(function() { var moment; if (typeof window === 'undefined') { moment = require('../../moment'); module = QUnit.module; } else { moment = window.moment; }
+/**************************************************
+ German
+ *************************************************/
+
+module("lang:de");
+
+test("format", 18, function() {
+ 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', '0 0. Sonntag 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++) {
+ equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
+ }
+});
+
+test("format ordinal", 31, function() {
+ moment.lang('de');
+ equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
+ equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
+ equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
+ equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');
+ equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');
+ equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');
+ equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');
+ equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');
+ equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');
+ equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');
+
+ equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');
+ equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');
+ equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');
+ equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');
+ equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');
+ equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');
+ equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');
+ equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');
+ equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');
+ equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');
+
+ equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');
+ equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');
+ equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');
+ equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');
+ equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');
+ equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');
+ equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');
+ equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');
+ equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');
+ equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');
+
+ equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');
+});
+
+test("format month", 12, function() {
+ 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++) {
+ equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
+ }
+});
+
+test("format week", 7, function() {
+ moment.lang('de');
+ var expected = 'Sonntag So._Montag Mo._Dienstag Di._Mittwoch Mi._Donnerstag Do._Freitag Fr._Samstag Sa.'.split("_");
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
+ }
+});
+
+test("from", 30, function() {
+ moment.lang('de');
+ var start = moment([2007, 1, 28]);
+ equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "ein paar Sekunden", "44 seconds = a few seconds");
+ equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "einer Minute", "45 seconds = a minute");
+ equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "einer Minute", "89 seconds = a minute");
+ equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 Minuten", "90 seconds = 2 minutes");
+ equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 Minuten", "44 minutes = 44 minutes");
+ equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "einer Stunde", "45 minutes = an hour");
+ equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "einer Stunde", "89 minutes = an hour");
+ equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 Stunden", "90 minutes = 2 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 Stunden", "5 hours = 5 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 Stunden", "21 hours = 21 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "einem Tag", "22 hours = a day");
+ equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "einem Tag", "35 hours = a day");
+ equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 Tagen", "36 hours = 2 days");
+ equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "einem Tag", "1 day = a day");
+ equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 Tagen", "5 days = 5 days");
+ equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 Tagen", "25 days = 25 days");
+ equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "einem Monat", "26 days = a month");
+ equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "einem Monat", "30 days = a month");
+ equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "einem Monat", "45 days = a month");
+ equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 Monaten", "46 days = 2 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 Monaten", "75 days = 2 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 Monaten", "76 days = 3 months");
+ equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "einem Monat", "1 month = a month");
+ equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 Monaten", "5 months = 5 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 Monaten", "344 days = 11 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "einem Jahr", "345 days = a year");
+ equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "einem Jahr", "547 days = a year");
+ equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 Jahren", "548 days = 2 years");
+ equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "einem Jahr", "1 year = a year");
+ equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 Jahren", "5 years = 5 years");
+});
+
+test("suffix", 2, function() {
+ moment.lang('de');
+ equal(moment(30000).from(0), "in ein paar Sekunden", "prefix");
+ equal(moment(0).from(30000), "vor ein paar Sekunden", "suffix");
+});
+
+test("fromNow", 2, function() {
+ moment.lang('de');
+ equal(moment().add({s:30}).fromNow(), "in ein paar Sekunden", "in a few seconds");
+ equal(moment().add({d:5}).fromNow(), "in 5 Tagen", "in 5 days");
+});
+
/**************************************************
English
*************************************************/
/**************************************************
- French
+ Spanish
*************************************************/
-module("lang:fr");
+module("lang:es");
test("format", 18, function() {
- moment.lang('fr');
+ moment.lang('es');
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.'],
+ ['dddd, MMMM Do YYYY, h:mm:ss a', 'Domingo, Febrero 14º 2010, 3:25:50 pm'],
+ ['ddd, hA', 'Dom., 3PM'],
+ ['M Mo MM MMMM MMM', '2 2º 02 Febrero Feb.'],
['YYYY YY', '2010 10'],
- ['D Do DD', '14 14ème 14'],
- ['d do dddd ddd', '0 0ème dimanche dim.'],
- ['DDD DDDo DDDD', '45 45ème 045'],
- ['w wo ww', '8 8ème 08'],
+ ['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ème day of the year'],
+ ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45º 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']
+ ['LL', '14 Febrero 2010'],
+ ['LLL', '14 Febrero 2010 15:25'],
+ ['LLLL', 'Domingo 14 Febrero 2010 15:25']
],
b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
i;
});
test("format ordinal", 31, function() {
- moment.lang('fr');
- equal(moment([2011, 0, 1]).format('DDDo'), '1er', '1er');
- equal(moment([2011, 0, 2]).format('DDDo'), '2ème', '2ème');
- equal(moment([2011, 0, 3]).format('DDDo'), '3ème', '3ème');
- equal(moment([2011, 0, 4]).format('DDDo'), '4ème', '4ème');
- equal(moment([2011, 0, 5]).format('DDDo'), '5ème', '5ème');
- equal(moment([2011, 0, 6]).format('DDDo'), '6ème', '6ème');
- equal(moment([2011, 0, 7]).format('DDDo'), '7ème', '7ème');
- equal(moment([2011, 0, 8]).format('DDDo'), '8ème', '8ème');
- equal(moment([2011, 0, 9]).format('DDDo'), '9ème', '9ème');
- equal(moment([2011, 0, 10]).format('DDDo'), '10ème', '10ème');
+ moment.lang('es');
+ equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
+ equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º');
+ equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º');
+ equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º');
+ equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º');
+ equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º');
+ equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º');
+ equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º');
+ equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º');
+ equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º');
- equal(moment([2011, 0, 11]).format('DDDo'), '11ème', '11ème');
- equal(moment([2011, 0, 12]).format('DDDo'), '12ème', '12ème');
- equal(moment([2011, 0, 13]).format('DDDo'), '13ème', '13ème');
- equal(moment([2011, 0, 14]).format('DDDo'), '14ème', '14ème');
- equal(moment([2011, 0, 15]).format('DDDo'), '15ème', '15ème');
- equal(moment([2011, 0, 16]).format('DDDo'), '16ème', '16ème');
- equal(moment([2011, 0, 17]).format('DDDo'), '17ème', '17ème');
- equal(moment([2011, 0, 18]).format('DDDo'), '18ème', '18ème');
- equal(moment([2011, 0, 19]).format('DDDo'), '19ème', '19ème');
- equal(moment([2011, 0, 20]).format('DDDo'), '20ème', '20ème');
+ equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º');
+ equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º');
+ equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º');
+ equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º');
+ equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º');
+ equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º');
+ equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º');
+ equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º');
+ equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º');
+ equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º');
- equal(moment([2011, 0, 21]).format('DDDo'), '21ème', '21ème');
- equal(moment([2011, 0, 22]).format('DDDo'), '22ème', '22ème');
- equal(moment([2011, 0, 23]).format('DDDo'), '23ème', '23ème');
- equal(moment([2011, 0, 24]).format('DDDo'), '24ème', '24ème');
- equal(moment([2011, 0, 25]).format('DDDo'), '25ème', '25ème');
- equal(moment([2011, 0, 26]).format('DDDo'), '26ème', '26ème');
- equal(moment([2011, 0, 27]).format('DDDo'), '27ème', '27ème');
- equal(moment([2011, 0, 28]).format('DDDo'), '28ème', '28ème');
- equal(moment([2011, 0, 29]).format('DDDo'), '29ème', '29ème');
- equal(moment([2011, 0, 30]).format('DDDo'), '30ème', '30ème');
+ equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º');
+ equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º');
+ equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º');
+ equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º');
+ equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º');
+ equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º');
+ equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º');
+ equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º');
+ equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º');
+ equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º');
- equal(moment([2011, 0, 31]).format('DDDo'), '31ème', '31ème');
+ equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º');
});
test("format month", 12, function() {
- 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("_");
+ 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++) {
equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
});
test("format week", 7, function() {
- moment.lang('fr');
- var expected = 'dimanche dim._lundi lun._mardi mar._mercredi mer._jeudi jeu._vendredi ven._samedi sam.'.split("_");
+ moment.lang('es');
+ var expected = 'Domingo Dom._Lunes Lun._Martes Mar._Miércoles Mié._Jueves Jue._Viernes Vie._Sábado Sáb.'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
});
test("from", 30, function() {
- moment.lang('fr');
+ moment.lang('es');
var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "quelques secondes", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "une minute", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "une minute", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutes", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutes", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "une heure", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "une heure", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 heures", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 heures", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 heures", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "un jour", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "un jour", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 jours", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "un jour", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 jours", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 jours", "25 days = 25 days");
+ equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "unos segundos", "44 seconds = a few seconds");
+ equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "un minuto", "45 seconds = a minute");
+ equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "un minuto", "89 seconds = a minute");
+ equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutos", "90 seconds = 2 minutes");
+ equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutos", "44 minutes = 44 minutes");
+ equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "una hora", "45 minutes = an hour");
+ equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "una hora", "89 minutes = an hour");
+ equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 horas", "90 minutes = 2 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 horas", "5 hours = 5 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 horas", "21 hours = 21 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "un día", "22 hours = a day");
+ equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "un día", "35 hours = a day");
+ equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 días", "36 hours = 2 days");
+ equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "un día", "1 day = a day");
+ equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 días", "5 days = 5 days");
+ equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 días", "25 days = 25 days");
+ equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "un mes", "26 days = a month");
+ equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "un mes", "30 days = a month");
+ equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "un mes", "45 days = a month");
+ equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 meses", "46 days = 2 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 meses", "75 days = 2 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 meses", "76 days = 3 months");
+ equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "un mes", "1 month = a month");
+ equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 meses", "5 months = 5 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 meses", "344 days = 11 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "un año", "345 days = a year");
+ equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "un año", "547 days = a year");
+ equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 años", "548 days = 2 years");
+ equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "un año", "1 year = a year");
+ equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 años", "5 years = 5 years");
+});
+
+test("suffix", 2, function() {
+ moment.lang('es');
+ equal(moment(30000).from(0), "en unos segundos", "prefix");
+ equal(moment(0).from(30000), "hace unos segundos", "suffix");
+});
+
+
+test("now from now", 1, function() {
+ moment.lang('es');
+ equal(moment().fromNow(), "hace unos segundos", "now from now should display as in the past");
+});
+
+
+test("fromNow", 2, function() {
+ moment.lang('es');
+ equal(moment().add({s:30}).fromNow(), "en unos segundos", "en unos segundos");
+ equal(moment().add({d:5}).fromNow(), "en 5 días", "en 5 días");
+});
+
+
+/**************************************************
+ French
+ *************************************************/
+
+module("lang:fr");
+
+test("format", 18, function() {
+ 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', '0 0ème dimanche dim.'],
+ ['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++) {
+ equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
+ }
+});
+
+test("format ordinal", 31, function() {
+ moment.lang('fr');
+ equal(moment([2011, 0, 1]).format('DDDo'), '1er', '1er');
+ equal(moment([2011, 0, 2]).format('DDDo'), '2ème', '2ème');
+ equal(moment([2011, 0, 3]).format('DDDo'), '3ème', '3ème');
+ equal(moment([2011, 0, 4]).format('DDDo'), '4ème', '4ème');
+ equal(moment([2011, 0, 5]).format('DDDo'), '5ème', '5ème');
+ equal(moment([2011, 0, 6]).format('DDDo'), '6ème', '6ème');
+ equal(moment([2011, 0, 7]).format('DDDo'), '7ème', '7ème');
+ equal(moment([2011, 0, 8]).format('DDDo'), '8ème', '8ème');
+ equal(moment([2011, 0, 9]).format('DDDo'), '9ème', '9ème');
+ equal(moment([2011, 0, 10]).format('DDDo'), '10ème', '10ème');
+
+ equal(moment([2011, 0, 11]).format('DDDo'), '11ème', '11ème');
+ equal(moment([2011, 0, 12]).format('DDDo'), '12ème', '12ème');
+ equal(moment([2011, 0, 13]).format('DDDo'), '13ème', '13ème');
+ equal(moment([2011, 0, 14]).format('DDDo'), '14ème', '14ème');
+ equal(moment([2011, 0, 15]).format('DDDo'), '15ème', '15ème');
+ equal(moment([2011, 0, 16]).format('DDDo'), '16ème', '16ème');
+ equal(moment([2011, 0, 17]).format('DDDo'), '17ème', '17ème');
+ equal(moment([2011, 0, 18]).format('DDDo'), '18ème', '18ème');
+ equal(moment([2011, 0, 19]).format('DDDo'), '19ème', '19ème');
+ equal(moment([2011, 0, 20]).format('DDDo'), '20ème', '20ème');
+
+ equal(moment([2011, 0, 21]).format('DDDo'), '21ème', '21ème');
+ equal(moment([2011, 0, 22]).format('DDDo'), '22ème', '22ème');
+ equal(moment([2011, 0, 23]).format('DDDo'), '23ème', '23ème');
+ equal(moment([2011, 0, 24]).format('DDDo'), '24ème', '24ème');
+ equal(moment([2011, 0, 25]).format('DDDo'), '25ème', '25ème');
+ equal(moment([2011, 0, 26]).format('DDDo'), '26ème', '26ème');
+ equal(moment([2011, 0, 27]).format('DDDo'), '27ème', '27ème');
+ equal(moment([2011, 0, 28]).format('DDDo'), '28ème', '28ème');
+ equal(moment([2011, 0, 29]).format('DDDo'), '29ème', '29ème');
+ equal(moment([2011, 0, 30]).format('DDDo'), '30ème', '30ème');
+
+ equal(moment([2011, 0, 31]).format('DDDo'), '31ème', '31ème');
+});
+
+test("format month", 12, function() {
+ 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++) {
+ equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
+ }
+});
+
+test("format week", 7, function() {
+ moment.lang('fr');
+ var expected = 'dimanche dim._lundi lun._mardi mar._mercredi mer._jeudi jeu._vendredi ven._samedi sam.'.split("_");
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
+ }
+});
+
+test("from", 30, function() {
+ moment.lang('fr');
+ var start = moment([2007, 1, 28]);
+ equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "quelques secondes", "44 seconds = a few seconds");
+ equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "une minute", "45 seconds = a minute");
+ equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "une minute", "89 seconds = a minute");
+ equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutes", "90 seconds = 2 minutes");
+ equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutes", "44 minutes = 44 minutes");
+ equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "une heure", "45 minutes = an hour");
+ equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "une heure", "89 minutes = an hour");
+ equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 heures", "90 minutes = 2 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 heures", "5 hours = 5 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 heures", "21 hours = 21 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "un jour", "22 hours = a day");
+ equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "un jour", "35 hours = a day");
+ equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 jours", "36 hours = 2 days");
+ equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "un jour", "1 day = a day");
+ equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 jours", "5 days = 5 days");
+ equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 jours", "25 days = 25 days");
equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "un mois", "26 days = a month");
equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "un mois", "30 days = a month");
equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "un mois", "45 days = a month");
});
/**************************************************
- Portuguese
+ Norwegian bokmål
*************************************************/
-module("lang:pt");
+module("lang:nb");
test("format", 18, function() {
- moment.lang('pt');
+ moment.lang('nb');
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 Feb'],
+ ['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', '0 0º Domingo Dom'],
- ['DDD DDDo DDDD', '45 45º 045'],
- ['w wo ww', '8 8º 08'],
+ ['D Do DD', '14 14. 14'],
+ ['d do dddd ddd', '0 0. søndag sø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 de Fevereiro de 2010'],
- ['LLL', '14 de Fevereiro de 2010 15:25'],
- ['LLLL', 'Domingo, 14 de Fevereiro de 2010 15:25']
+ ['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;
});
test("format ordinal", 31, function() {
- moment.lang('pt');
- equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
- equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º');
- equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º');
- equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º');
- equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º');
- equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º');
- equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º');
- equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º');
- equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º');
- equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º');
+ moment.lang('nb');
+ equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
+ equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
+ equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
+ equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');
+ equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');
+ equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');
+ equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');
+ equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');
+ equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');
+ equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');
- equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º');
- equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º');
- equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º');
- equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º');
- equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º');
- equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º');
- equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º');
- equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º');
- equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º');
- equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º');
+ equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');
+ equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');
+ equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');
+ equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');
+ equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');
+ equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');
+ equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');
+ equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');
+ equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');
+ equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');
- equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º');
- equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º');
- equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º');
- equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º');
- equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º');
- equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º');
- equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º');
- equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º');
- equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º');
- equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º');
+ equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');
+ equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');
+ equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');
+ equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');
+ equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');
+ equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');
+ equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');
+ equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');
+ equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');
+ equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');
- equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º');
+ equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');
});
test("format month", 12, function() {
- moment.lang('pt');
- var expected = 'Janeiro Jan_Fevereiro Feb_Março Mar_Abril Abr_Maio Mai_Junho Jun_Julho Jul_Agosto Ago_Setembro Set_Outubro Out_Novembro Nov_Dezembro Dez'.split("_");
+ 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++) {
equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
});
test("format week", 7, function() {
- moment.lang('pt');
- 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("_");
+ moment.lang('nb');
+ var expected = 'søndag søn_mandag man_tirsdag tir_onsdag ons_torsdag tor_fredag fre_lørdag lør'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
});
test("from", 30, function() {
- moment.lang('pt');
+ moment.lang('nb');
var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "segundos", "44 seconds = seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "um minuto", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "um minuto", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutos", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutos", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "uma hora", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "uma hora", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 horas", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 horas", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 horas", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "um dia", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "um dia", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dias", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "um dia", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dias", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dias", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "um mês", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "um mês", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "um mês", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 meses", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 meses", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 meses", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "um mês", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 meses", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 meses", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "um ano", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "um ano", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 anos", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "um ano", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 anos", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('pt');
- equal(moment(30000).from(0), "em segundos", "prefix");
- equal(moment(0).from(30000), "segundos atrás", "suffix");
-});
-
-test("fromNow", 2, function() {
- moment.lang('pt');
- equal(moment().add({s:30}).fromNow(), "em segundos", "in seconds");
- equal(moment().add({d:5}).fromNow(), "em 5 dias", "in 5 days");
-});
-
-/**************************************************
- Spanish
- *************************************************/
-
-module("lang:es");
-
-test("format", 18, function() {
- moment.lang('es');
- var a = [
- ['dddd, MMMM Do YYYY, h:mm:ss a', 'Domingo, Febrero 14º 2010, 3:25:50 pm'],
- ['ddd, hA', 'Dom., 3PM'],
- ['M Mo MM MMMM MMM', '2 2º 02 Febrero Feb.'],
- ['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 Febrero 2010'],
- ['LLL', '14 Febrero 2010 15:25'],
- ['LLLL', 'Domingo 14 Febrero 2010 15:25']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('es');
- equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
- equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º');
- equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º');
- equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º');
- equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º');
- equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º');
- equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º');
- equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º');
- equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º');
- equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º');
- equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º');
- equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º');
- equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º');
- equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º');
- equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º');
- equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º');
- equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º');
- equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º');
- equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º');
- equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º');
- equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º');
- equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º');
- equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º');
- equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º');
- equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º');
- equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º');
- equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º');
- equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º');
-});
-
-test("format month", 12, function() {
- 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++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('es');
- var expected = 'Domingo Dom._Lunes Lun._Martes Mar._Miércoles Mié._Jueves Jue._Viernes Vie._Sábado Sáb.'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('es');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "unos segundos", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "un minuto", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "un minuto", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutos", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutos", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "una hora", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "una hora", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 horas", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 horas", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 horas", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "un día", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "un día", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 días", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "un día", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 días", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 días", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "un mes", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "un mes", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "un mes", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 meses", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 meses", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 meses", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "un mes", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 meses", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 meses", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "un año", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "un año", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 años", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "un año", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 años", "5 years = 5 years");
+ equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "noen sekunder", "44 sekunder = a few seconds");
+ equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "ett minutt", "45 seconds = a minute");
+ equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "ett minutt", "89 seconds = a minute");
+ equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutter", "90 seconds = 2 minutes");
+ equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutter", "44 minutes = 44 minutes");
+ equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "en time", "45 minutes = an hour");
+ equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "en time", "89 minutes = an hour");
+ equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 timer", "90 minutes = 2 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 timer", "5 hours = 5 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 timer", "21 hours = 21 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "en dag", "22 hours = a day");
+ equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "en dag", "35 hours = a day");
+ equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dager", "36 hours = 2 days");
+ equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "en dag", "1 day = a day");
+ equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dager", "5 days = 5 days");
+ equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dager", "25 days = 25 days");
+ equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "en måned", "26 days = a month");
+ equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "en måned", "30 days = a month");
+ equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "en måned", "45 days = a month");
+ equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 måneder", "46 days = 2 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 måneder", "75 days = 2 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 måneder", "76 days = 3 months");
+ equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "en måned", "1 month = a month");
+ equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 måneder", "5 months = 5 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 måneder", "344 days = 11 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "ett år", "345 days = a year");
+ equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "ett år", "547 days = a year");
+ equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 år", "548 days = 2 years");
+ equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "ett år", "1 year = a year");
+ equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 år", "5 years = 5 years");
});
test("suffix", 2, function() {
- moment.lang('es');
- equal(moment(30000).from(0), "en unos segundos", "prefix");
- equal(moment(0).from(30000), "hace unos segundos", "suffix");
+ moment.lang('nb');
+ equal(moment(30000).from(0), "om noen sekunder", "prefix");
+ equal(moment(0).from(30000), "for noen sekunder siden", "suffix");
});
test("now from now", 1, function() {
- moment.lang('es');
- equal(moment().fromNow(), "hace unos segundos", "now from now should display as in the past");
+ moment.lang('nb');
+ equal(moment().fromNow(), "for noen sekunder siden", "now from now should display as in the past");
});
test("fromNow", 2, function() {
- moment.lang('es');
- equal(moment().add({s:30}).fromNow(), "en unos segundos", "en unos segundos");
- equal(moment().add({d:5}).fromNow(), "en 5 días", "en 5 días");
+ moment.lang('nb');
+ equal(moment().add({s:30}).fromNow(), "om noen sekunder", "in a few seconds");
+ equal(moment().add({d:5}).fromNow(), "om 5 dager", "in 5 days");
});
equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 jaren", "5 years = 5 years");
});
-test("suffix", 2, function() {
- moment.lang('nl');
- equal(moment(30000).from(0), "over een paar seconden", "prefix");
- equal(moment(0).from(30000), "een paar seconden geleden", "suffix");
+test("suffix", 2, function() {
+ moment.lang('nl');
+ equal(moment(30000).from(0), "over een paar seconden", "prefix");
+ equal(moment(0).from(30000), "een paar seconden geleden", "suffix");
+});
+
+
+test("now from now", 1, function() {
+ moment.lang('nl');
+ equal(moment().fromNow(), "een paar seconden geleden", "now from now should display as in the past");
+});
+
+
+test("fromNow", 2, function() {
+ moment.lang('nl');
+ equal(moment().add({s:30}).fromNow(), "over een paar seconden", "in a few seconds");
+ equal(moment().add({d:5}).fromNow(), "over 5 dagen", "in 5 days");
+});
+
+
+/**************************************************
+ Polish
+ *************************************************/
+
+module("lang:pl");
+
+test("format", 18, function() {
+ 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', '0 0. niedziela nie'],
+ ['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++) {
+ equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
+ }
+});
+
+test("format ordinal", 31, function() {
+ moment.lang('pl');
+ equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
+ equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
+ equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
+ equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');
+ equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');
+ equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');
+ equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');
+ equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');
+ equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');
+ equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');
+
+ equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');
+ equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');
+ equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');
+ equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');
+ equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');
+ equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');
+ equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');
+ equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');
+ equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');
+ equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');
+
+ equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');
+ equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');
+ equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');
+ equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');
+ equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');
+ equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');
+ equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');
+ equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');
+ equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');
+ equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');
+
+ equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');
+});
+
+test("format month", 12, function() {
+ 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++) {
+ equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
+ }
+});
+
+test("format week", 7, function() {
+ moment.lang('pl');
+ var expected = 'niedziela nie_poniedziałek pon_wtorek wt_środa śr_czwartek czw_piątek pt_sobota sb'.split("_");
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
+ }
+});
+
+test("from", 30, function() {
+ moment.lang('pl');
+ var start = moment([2007, 1, 28]);
+ equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "kilka sekund", "44 seconds = a few seconds");
+ equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "minuta", "45 seconds = a minute");
+ equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "minuta", "89 seconds = a minute");
+ equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minuty", "90 seconds = 2 minutes");
+ equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minuty", "44 minutes = 44 minutes");
+ equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "godzina", "45 minutes = an hour");
+ equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "godzina", "89 minutes = an hour");
+ equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 godziny", "90 minutes = 2 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 godzin", "5 hours = 5 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 godzin", "21 hours = 21 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "1 dzień", "22 hours = a day");
+ equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "1 dzień", "35 hours = a day");
+ equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dni", "36 hours = 2 days");
+ equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "1 dzień", "1 day = a day");
+ equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dni", "5 days = 5 days");
+ equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dni", "25 days = 25 days");
+ equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "miesiąc", "26 days = a month");
+ equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "miesiąc", "30 days = a month");
+ equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "miesiąc", "45 days = a month");
+ equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 miesiące", "46 days = 2 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 miesiące", "75 days = 2 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 miesiące", "76 days = 3 months");
+ equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "miesiąc", "1 month = a month");
+ equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 miesięcy", "5 months = 5 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 miesięcy", "344 days = 11 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "rok", "345 days = a year");
+ equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "rok", "547 days = a year");
+ equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 lata", "548 days = 2 years");
+ equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "rok", "1 year = a year");
+ equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 lat", "5 years = 5 years");
+});
+
+test("suffix", 2, function() {
+ moment.lang('pl');
+ equal(moment(30000).from(0), "za kilka sekund", "prefix");
+ equal(moment(0).from(30000), "kilka sekund temu", "suffix");
+});
+
+
+test("now from now", 1, function() {
+ moment.lang('pl');
+ equal(moment().fromNow(), "kilka sekund temu", "now from now should display as in the past");
+});
+
+
+test("fromNow", 3, function() {
+ moment.lang('pl');
+ equal(moment().add({s:30}).fromNow(), "za kilka sekund", "in a few seconds");
+ equal(moment().add({h:1}).fromNow(), "za godzinę", "in an hour");
+ equal(moment().add({d:5}).fromNow(), "za 5 dni", "in 5 days");
+});
+
+
+/**************************************************
+ Portuguese
+ *************************************************/
+
+module("lang:pt");
+
+test("format", 18, function() {
+ 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 Feb'],
+ ['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++) {
+ equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
+ }
+});
+
+test("format ordinal", 31, function() {
+ moment.lang('pt');
+ equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
+ equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º');
+ equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º');
+ equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º');
+ equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º');
+ equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º');
+ equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º');
+ equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º');
+ equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º');
+ equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º');
+
+ equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º');
+ equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º');
+ equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º');
+ equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º');
+ equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º');
+ equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º');
+ equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º');
+ equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º');
+ equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º');
+ equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º');
+
+ equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º');
+ equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º');
+ equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º');
+ equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º');
+ equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º');
+ equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º');
+ equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º');
+ equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º');
+ equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º');
+ equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º');
+
+ equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º');
+});
+
+test("format month", 12, function() {
+ moment.lang('pt');
+ var expected = 'Janeiro Jan_Fevereiro Feb_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++) {
+ equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
+ }
+});
+
+test("format week", 7, function() {
+ moment.lang('pt');
+ 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++) {
+ equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
+ }
+});
+
+test("from", 30, function() {
+ moment.lang('pt');
+ var start = moment([2007, 1, 28]);
+ equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "segundos", "44 seconds = seconds");
+ equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "um minuto", "45 seconds = a minute");
+ equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "um minuto", "89 seconds = a minute");
+ equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutos", "90 seconds = 2 minutes");
+ equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutos", "44 minutes = 44 minutes");
+ equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "uma hora", "45 minutes = an hour");
+ equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "uma hora", "89 minutes = an hour");
+ equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 horas", "90 minutes = 2 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 horas", "5 hours = 5 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 horas", "21 hours = 21 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "um dia", "22 hours = a day");
+ equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "um dia", "35 hours = a day");
+ equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dias", "36 hours = 2 days");
+ equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "um dia", "1 day = a day");
+ equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dias", "5 days = 5 days");
+ equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dias", "25 days = 25 days");
+ equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "um mês", "26 days = a month");
+ equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "um mês", "30 days = a month");
+ equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "um mês", "45 days = a month");
+ equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 meses", "46 days = 2 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 meses", "75 days = 2 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 meses", "76 days = 3 months");
+ equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "um mês", "1 month = a month");
+ equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 meses", "5 months = 5 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 meses", "344 days = 11 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "um ano", "345 days = a year");
+ equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "um ano", "547 days = a year");
+ equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 anos", "548 days = 2 years");
+ equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "um ano", "1 year = a year");
+ equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 anos", "5 years = 5 years");
});
-
-test("now from now", 1, function() {
- moment.lang('nl');
- equal(moment().fromNow(), "een paar seconden geleden", "now from now should display as in the past");
+test("suffix", 2, function() {
+ moment.lang('pt');
+ equal(moment(30000).from(0), "em segundos", "prefix");
+ equal(moment(0).from(30000), "segundos atrás", "suffix");
});
-
test("fromNow", 2, function() {
- moment.lang('nl');
- equal(moment().add({s:30}).fromNow(), "over een paar seconden", "in a few seconds");
- equal(moment().add({d:5}).fromNow(), "over 5 dagen", "in 5 days");
+ moment.lang('pt');
+ equal(moment().add({s:30}).fromNow(), "em segundos", "in seconds");
+ equal(moment().add({d:5}).fromNow(), "em 5 dias", "in 5 days");
});
-
/**************************************************
- German
+ Russian
*************************************************/
-module("lang:de");
+module("lang:ru");
test("format", 18, function() {
- moment.lang('de');
+ moment.lang('ru');
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.'],
+ ['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', '0 0. Sonntag So.'],
+ ['d do dddd ddd', '0 0. воскресенье вск'],
['DDD DDDo DDDD', '45 45. 045'],
['w wo ww', '8 8. 08'],
['h hh', '3 03'],
['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']
+ ['L', '14-02-2010'],
+ ['LL', '14 февраль 2010'],
+ ['LLL', '14 февраль 2010 15:25'],
+ ['LLLL', 'воскресенье, 14 февраль 2010 15:25']
],
b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
i;
});
test("format ordinal", 31, function() {
- moment.lang('de');
+ moment.lang('ru');
equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
});
test("format month", 12, function() {
- 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("_");
+ moment.lang('ru');
+ var expected = 'январь янв_февраль фев_март мар_апрель апр_май май_июнь июн_июль июл_август авг_сентябрь сен_октябрь окт_ноябрь ноя_декабрь дек'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
});
test("format week", 7, function() {
- moment.lang('de');
- var expected = 'Sonntag So._Montag Mo._Dienstag Di._Mittwoch Mi._Donnerstag Do._Freitag Fr._Samstag Sa.'.split("_");
+ moment.lang('ru');
+ var expected = 'воскресенье вск_понедельник пнд_вторник втр_среда срд_четверг чтв_пятница птн_суббота суб'.split("_");
var i;
for (i = 0; i < expected.length; i++) {
equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
});
test("from", 30, function() {
- moment.lang('de');
+ moment.lang('ru');
var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "ein paar Sekunden", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "einer Minute", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "einer Minute", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 Minuten", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 Minuten", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "einer Stunde", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "einer Stunde", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 Stunden", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 Stunden", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 Stunden", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "einem Tag", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "einem Tag", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 Tagen", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "einem Tag", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 Tagen", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 Tagen", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "einem Monat", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "einem Monat", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "einem Monat", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 Monaten", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 Monaten", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 Monaten", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "einem Monat", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 Monaten", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 Monaten", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "einem Jahr", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "einem Jahr", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 Jahren", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "einem Jahr", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 Jahren", "5 years = 5 years");
+ equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "несколько секунд", "44 seconds = seconds");
+ equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "минут", "45 seconds = a minute");
+ equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "минут", "89 seconds = a minute");
+ equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 минут", "90 seconds = 2 minutes");
+ equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 минут", "44 minutes = 44 minutes");
+ equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "часа", "45 minutes = an hour");
+ equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "часа", "89 minutes = an hour");
+ equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 часов", "90 minutes = 2 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 часов", "5 hours = 5 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 часов", "21 hours = 21 hours");
+ equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "1 день", "22 hours = a day");
+ equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "1 день", "35 hours = a day");
+ equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 дней", "36 hours = 2 days");
+ equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "1 день", "1 day = a day");
+ equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 дней", "5 days = 5 days");
+ equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 дней", "25 days = 25 days");
+ equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "месяц", "26 days = a month");
+ equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "месяц", "30 days = a month");
+ equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "месяц", "45 days = a month");
+ equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 месяцев", "46 days = 2 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 месяцев", "75 days = 2 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 месяцев", "76 days = 3 months");
+ equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "месяц", "1 month = a month");
+ equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 месяцев", "5 months = 5 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 месяцев", "344 days = 11 months");
+ equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "год", "345 days = a year");
+ equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "год", "547 days = a year");
+ equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 лет", "548 days = 2 years");
+ equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "год", "1 year = a year");
+ equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 лет", "5 years = 5 years");
});
test("suffix", 2, function() {
- moment.lang('de');
- equal(moment(30000).from(0), "in ein paar Sekunden", "prefix");
- equal(moment(0).from(30000), "vor ein paar Sekunden", "suffix");
+ moment.lang('ru');
+ equal(moment(30000).from(0), "через несколько секунд", "prefix");
+ equal(moment(0).from(30000), "несколько секунд назад", "suffix");
});
test("fromNow", 2, function() {
- moment.lang('de');
- equal(moment().add({s:30}).fromNow(), "in ein paar Sekunden", "in a few seconds");
- equal(moment().add({d:5}).fromNow(), "in 5 Tagen", "in 5 days");
+ moment.lang('ru');
+ equal(moment().add({s:30}).fromNow(), "через несколько секунд", "in seconds");
+ equal(moment().add({d:5}).fromNow(), "через 5 дней", "in 5 days");
});
/**************************************************
equal(moment().add({d:5}).fromNow(), "om 5 dagar", "in 5 days");
});
-
-/**************************************************
- Polish
- *************************************************/
-
-module("lang:pl");
-
-test("format", 18, function() {
- 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', '0 0. niedziela nie'],
- ['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++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('pl');
- equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
- equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
- equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
- equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');
- equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');
- equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');
- equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');
- equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');
- equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');
- equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');
- equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');
- equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');
- equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');
- equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');
- equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');
- equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');
- equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');
- equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');
- equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');
- equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');
- equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');
- equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');
- equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');
- equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');
- equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');
- equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');
- equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');
- equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');
-});
-
-test("format month", 12, function() {
- 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++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('pl');
- var expected = 'niedziela nie_poniedziałek pon_wtorek wt_środa śr_czwartek czw_piątek pt_sobota sb'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('pl');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "kilka sekund", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "minuta", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "minuta", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minuty", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minuty", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "godzina", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "godzina", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 godziny", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 godzin", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 godzin", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "1 dzień", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "1 dzień", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dni", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "1 dzień", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dni", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dni", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "miesiąc", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "miesiąc", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "miesiąc", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 miesiące", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 miesiące", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 miesiące", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "miesiąc", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 miesięcy", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 miesięcy", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "rok", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "rok", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 lata", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "rok", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 lat", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('pl');
- equal(moment(30000).from(0), "za kilka sekund", "prefix");
- equal(moment(0).from(30000), "kilka sekund temu", "suffix");
-});
-
-
-test("now from now", 1, function() {
- moment.lang('pl');
- equal(moment().fromNow(), "kilka sekund temu", "now from now should display as in the past");
-});
-
-
-test("fromNow", 3, function() {
- moment.lang('pl');
- equal(moment().add({s:30}).fromNow(), "za kilka sekund", "in a few seconds");
- equal(moment().add({h:1}).fromNow(), "za godzinę", "in an hour");
- equal(moment().add({d:5}).fromNow(), "za 5 dni", "in 5 days");
-});
-
})();
\ No newline at end of file