From: Kunal Marwaha Date: Tue, 22 Sep 2020 08:26:21 +0000 (-0700) Subject: Build 2.29.0 X-Git-Tag: 2.29.0^0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=adfaae8051588fcdb9347f0221e5ac1663f3a95c;p=thirdparty%2Fmoment.git Build 2.29.0 --- diff --git a/component.json b/component.json index 5e6014299..30369b581 100644 --- a/component.json +++ b/component.json @@ -17,6 +17,7 @@ "locale/be.js", "locale/bg.js", "locale/bm.js", + "locale/bn-bd.js", "locale/bn.js", "locale/bo.js", "locale/br.js", @@ -41,6 +42,7 @@ "locale/en-sg.js", "locale/eo.js", "locale/es-do.js", + "locale/es-mx.js", "locale/es-us.js", "locale/es.js", "locale/et.js", diff --git a/dist/locale/ar-ly.js b/dist/locale/ar-ly.js index 9d423de6a..badff8776 100644 --- a/dist/locale/ar-ly.js +++ b/dist/locale/ar-ly.js @@ -5,16 +5,16 @@ import moment from '../moment'; var symbolMap = { - '1': '1', - '2': '2', - '3': '3', - '4': '4', - '5': '5', - '6': '6', - '7': '7', - '8': '8', - '9': '9', - '0': '0', + 1: '1', + 2: '2', + 3: '3', + 4: '4', + 5: '5', + 6: '6', + 7: '7', + 8: '8', + 9: '9', + 0: '0', }, pluralForm = function (n) { return n === 0 diff --git a/dist/locale/ar-ma.js b/dist/locale/ar-ma.js index c11fc334f..6b7011e8a 100644 --- a/dist/locale/ar-ma.js +++ b/dist/locale/ar-ma.js @@ -49,7 +49,7 @@ export default moment.defineLocale('ar-ma', { yy: '%d سنوات', }, week: { - dow: 6, // Saturday is the first day of the week. - doy: 12, // The week that contains Jan 12th is the first week of the year. + dow: 1, // Monday is the first day of the week. + doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); diff --git a/dist/locale/ar-sa.js b/dist/locale/ar-sa.js index 91aa90809..7acac9005 100644 --- a/dist/locale/ar-sa.js +++ b/dist/locale/ar-sa.js @@ -5,16 +5,16 @@ import moment from '../moment'; var symbolMap = { - '1': '١', - '2': '٢', - '3': '٣', - '4': '٤', - '5': '٥', - '6': '٦', - '7': '٧', - '8': '٨', - '9': '٩', - '0': '٠', + 1: '١', + 2: '٢', + 3: '٣', + 4: '٤', + 5: '٥', + 6: '٦', + 7: '٧', + 8: '٨', + 9: '٩', + 0: '٠', }, numberMap = { '١': '1', diff --git a/dist/locale/ar.js b/dist/locale/ar.js index 88efc3365..fb430b964 100644 --- a/dist/locale/ar.js +++ b/dist/locale/ar.js @@ -7,16 +7,16 @@ import moment from '../moment'; var symbolMap = { - '1': '١', - '2': '٢', - '3': '٣', - '4': '٤', - '5': '٥', - '6': '٦', - '7': '٧', - '8': '٨', - '9': '٩', - '0': '٠', + 1: '١', + 2: '٢', + 3: '٣', + 4: '٤', + 5: '٥', + 6: '٦', + 7: '٧', + 8: '٨', + 9: '٩', + 0: '٠', }, numberMap = { '١': '1', diff --git a/dist/locale/bg.js b/dist/locale/bg.js index 179e63d6c..e8b060fab 100644 --- a/dist/locale/bg.js +++ b/dist/locale/bg.js @@ -53,6 +53,8 @@ export default moment.defineLocale('bg', { hh: '%d часа', d: 'ден', dd: '%d дена', + w: 'седмица', + ww: '%d седмици', M: 'месец', MM: '%d месеца', y: 'година', diff --git a/dist/locale/bn-bd.js b/dist/locale/bn-bd.js new file mode 100644 index 000000000..75e83f23f --- /dev/null +++ b/dist/locale/bn-bd.js @@ -0,0 +1,128 @@ +//! moment.js locale configuration +//! locale : Bengali (Bangladesh) [bn-bd] +//! author : Asraf Hossain Patoary : https://github.com/ashwoolford + +import moment from '../moment'; + +var symbolMap = { + 1: '১', + 2: '২', + 3: '৩', + 4: '৪', + 5: '৫', + 6: '৬', + 7: '৭', + 8: '৮', + 9: '৯', + 0: '০', + }, + numberMap = { + '১': '1', + '২': '2', + '৩': '3', + '৪': '4', + '৫': '5', + '৬': '6', + '৭': '7', + '৮': '8', + '৯': '9', + '০': '0', + }; + +export default moment.defineLocale('bn-bd', { + months: 'জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split( + '_' + ), + monthsShort: 'জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে'.split( + '_' + ), + weekdays: 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার'.split( + '_' + ), + weekdaysShort: 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি'.split('_'), + weekdaysMin: 'রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি'.split('_'), + longDateFormat: { + LT: 'A h:mm সময়', + LTS: 'A h:mm:ss সময়', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY, A h:mm সময়', + LLLL: 'dddd, D MMMM YYYY, A h:mm সময়', + }, + calendar: { + sameDay: '[আজ] LT', + nextDay: '[আগামীকাল] LT', + nextWeek: 'dddd, LT', + lastDay: '[গতকাল] LT', + lastWeek: '[গত] dddd, LT', + sameElse: 'L', + }, + relativeTime: { + future: '%s পরে', + past: '%s আগে', + s: 'কয়েক সেকেন্ড', + ss: '%d সেকেন্ড', + m: 'এক মিনিট', + mm: '%d মিনিট', + h: 'এক ঘন্টা', + hh: '%d ঘন্টা', + d: 'এক দিন', + dd: '%d দিন', + M: 'এক মাস', + MM: '%d মাস', + y: 'এক বছর', + yy: '%d বছর', + }, + preparse: function (string) { + return string.replace(/[১২৩৪৫৬৭৮৯০]/g, function (match) { + return numberMap[match]; + }); + }, + postformat: function (string) { + return string.replace(/\d/g, function (match) { + return symbolMap[match]; + }); + }, + + meridiemParse: /রাত|ভোর|সকাল|দুপুর|বিকাল|সন্ধ্যা|রাত/, + meridiemHour: function (hour, meridiem) { + if (hour === 12) { + hour = 0; + } + if (meridiem === 'রাত') { + return hour < 4 ? hour : hour + 12; + } else if (meridiem === 'ভোর') { + return hour; + } else if (meridiem === 'সকাল') { + return hour; + } else if (meridiem === 'দুপুর') { + return hour >= 3 ? hour : hour + 12; + } else if (meridiem === 'বিকাল') { + return hour + 12; + } else if (meridiem === 'সন্ধ্যা') { + return hour + 12; + } + }, + + meridiem: function (hour, minute, isLower) { + if (hour < 4) { + return 'রাত'; + } else if (hour < 6) { + return 'ভোর'; + } else if (hour < 12) { + return 'সকাল'; + } else if (hour < 15) { + return 'দুপুর'; + } else if (hour < 18) { + return 'বিকাল'; + } else if (hour < 20) { + return 'সন্ধ্যা'; + } else { + return 'রাত'; + } + }, + week: { + dow: 0, // Sunday is the first day of the week. + doy: 6, // The week that contains Jan 6th is the first week of the year. + }, +}); diff --git a/dist/locale/bn.js b/dist/locale/bn.js index c4cec3b75..0a2cc93eb 100644 --- a/dist/locale/bn.js +++ b/dist/locale/bn.js @@ -5,16 +5,16 @@ import moment from '../moment'; var symbolMap = { - '1': '১', - '2': '২', - '3': '৩', - '4': '৪', - '5': '৫', - '6': '৬', - '7': '৭', - '8': '৮', - '9': '৯', - '0': '০', + 1: '১', + 2: '২', + 3: '৩', + 4: '৪', + 5: '৫', + 6: '৬', + 7: '৭', + 8: '৮', + 9: '৯', + 0: '০', }, numberMap = { '১': '1', diff --git a/dist/locale/bo.js b/dist/locale/bo.js index 8901a461f..ed2d6ed03 100644 --- a/dist/locale/bo.js +++ b/dist/locale/bo.js @@ -5,16 +5,16 @@ import moment from '../moment'; var symbolMap = { - '1': '༡', - '2': '༢', - '3': '༣', - '4': '༤', - '5': '༥', - '6': '༦', - '7': '༧', - '8': '༨', - '9': '༩', - '0': '༠', + 1: '༡', + 2: '༢', + 3: '༣', + 4: '༤', + 5: '༥', + 6: '༦', + 7: '༧', + 8: '༨', + 9: '༩', + 0: '༠', }, numberMap = { '༡': '1', diff --git a/dist/locale/es-do.js b/dist/locale/es-do.js index 82f1d2636..88e3c4ca4 100644 --- a/dist/locale/es-do.js +++ b/dist/locale/es-do.js @@ -88,6 +88,8 @@ export default moment.defineLocale('es-do', { hh: '%d horas', d: 'un día', dd: '%d días', + w: 'una semana', + ww: '%d semanas', M: 'un mes', MM: '%d meses', y: 'un año', diff --git a/dist/locale/es-mx.js b/dist/locale/es-mx.js new file mode 100644 index 000000000..0ed4332ed --- /dev/null +++ b/dist/locale/es-mx.js @@ -0,0 +1,106 @@ +//! moment.js locale configuration +//! locale : Spanish (Mexico) [es-mx] +//! author : JC Franco : https://github.com/jcfranco + +import moment from '../moment'; + +var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split( + '_' + ), + monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'), + monthsParse = [ + /^ene/i, + /^feb/i, + /^mar/i, + /^abr/i, + /^may/i, + /^jun/i, + /^jul/i, + /^ago/i, + /^sep/i, + /^oct/i, + /^nov/i, + /^dic/i, + ], + monthsRegex = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i; + +export default moment.defineLocale('es-mx', { + months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split( + '_' + ), + monthsShort: function (m, format) { + if (!m) { + return monthsShortDot; + } else if (/-MMM-/.test(format)) { + return monthsShort[m.month()]; + } else { + return monthsShortDot[m.month()]; + } + }, + monthsRegex: monthsRegex, + monthsShortRegex: monthsRegex, + monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i, + monthsShortStrictRegex: /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i, + monthsParse: monthsParse, + longMonthsParse: monthsParse, + shortMonthsParse: monthsParse, + weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'), + weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'), + weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'), + weekdaysParseExact: true, + longDateFormat: { + LT: 'H:mm', + LTS: 'H:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D [de] MMMM [de] YYYY', + LLL: 'D [de] MMMM [de] YYYY H:mm', + LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm', + }, + calendar: { + sameDay: function () { + return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; + }, + nextDay: function () { + return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; + }, + nextWeek: function () { + return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; + }, + lastDay: function () { + return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; + }, + lastWeek: function () { + return ( + '[el] dddd [pasado a la' + + (this.hours() !== 1 ? 's' : '') + + '] LT' + ); + }, + sameElse: 'L', + }, + relativeTime: { + future: 'en %s', + past: 'hace %s', + s: 'unos segundos', + ss: '%d segundos', + m: 'un minuto', + mm: '%d minutos', + h: 'una hora', + hh: '%d horas', + d: 'un día', + dd: '%d días', + w: 'una semana', + ww: '%d semanas', + M: 'un mes', + MM: '%d meses', + y: 'un año', + yy: '%d años', + }, + dayOfMonthOrdinalParse: /\d{1,2}º/, + ordinal: '%dº', + week: { + dow: 0, // Sunday is the first day of the week. + doy: 4, // The week that contains Jan 4th is the first week of the year. + }, + invalidDate: 'Fecha inválida', +}); diff --git a/dist/locale/es-us.js b/dist/locale/es-us.js index 592f5bf25..3bbc8126c 100644 --- a/dist/locale/es-us.js +++ b/dist/locale/es-us.js @@ -90,6 +90,8 @@ export default moment.defineLocale('es-us', { hh: '%d horas', d: 'un día', dd: '%d días', + w: 'una semana', + ww: '%d semanas', M: 'un mes', MM: '%d meses', y: 'un año', diff --git a/dist/locale/es.js b/dist/locale/es.js index a989dc7ff..18b01e1a5 100644 --- a/dist/locale/es.js +++ b/dist/locale/es.js @@ -89,6 +89,8 @@ export default moment.defineLocale('es', { hh: '%d horas', d: 'un día', dd: '%d días', + w: 'una semana', + ww: '%d semanas', M: 'un mes', MM: '%d meses', y: 'un año', diff --git a/dist/locale/fa.js b/dist/locale/fa.js index d9259ad23..1611e1024 100644 --- a/dist/locale/fa.js +++ b/dist/locale/fa.js @@ -5,16 +5,16 @@ import moment from '../moment'; var symbolMap = { - '1': '۱', - '2': '۲', - '3': '۳', - '4': '۴', - '5': '۵', - '6': '۶', - '7': '۷', - '8': '۸', - '9': '۹', - '0': '۰', + 1: '۱', + 2: '۲', + 3: '۳', + 4: '۴', + 5: '۵', + 6: '۶', + 7: '۷', + 8: '۸', + 9: '۹', + 0: '۰', }, numberMap = { '۱': '1', diff --git a/dist/locale/fr.js b/dist/locale/fr.js index 4ec6150fc..212f664c6 100644 --- a/dist/locale/fr.js +++ b/dist/locale/fr.js @@ -67,6 +67,8 @@ export default moment.defineLocale('fr', { hh: '%d heures', d: 'un jour', dd: '%d jours', + w: 'une semaine', + ww: '%d semaines', M: 'un mois', MM: '%d mois', y: 'un an', diff --git a/dist/locale/gu.js b/dist/locale/gu.js index c88b0af7f..cd35358db 100644 --- a/dist/locale/gu.js +++ b/dist/locale/gu.js @@ -5,16 +5,16 @@ import moment from '../moment'; var symbolMap = { - '1': '૧', - '2': '૨', - '3': '૩', - '4': '૪', - '5': '૫', - '6': '૬', - '7': '૭', - '8': '૮', - '9': '૯', - '0': '૦', + 1: '૧', + 2: '૨', + 3: '૩', + 4: '૪', + 5: '૫', + 6: '૬', + 7: '૭', + 8: '૮', + 9: '૯', + 0: '૦', }, numberMap = { '૧': '1', diff --git a/dist/locale/hi.js b/dist/locale/hi.js index c5a699e6d..9c4184112 100644 --- a/dist/locale/hi.js +++ b/dist/locale/hi.js @@ -5,16 +5,16 @@ import moment from '../moment'; var symbolMap = { - '1': '१', - '2': '२', - '3': '३', - '4': '४', - '5': '५', - '6': '६', - '7': '७', - '8': '८', - '9': '९', - '0': '०', + 1: '१', + 2: '२', + 3: '३', + 4: '४', + 5: '५', + 6: '६', + 7: '७', + 8: '८', + 9: '९', + 0: '०', }, numberMap = { '१': '1', diff --git a/dist/locale/hu.js b/dist/locale/hu.js index 223235e50..31a6bfbd1 100644 --- a/dist/locale/hu.js +++ b/dist/locale/hu.js @@ -1,6 +1,7 @@ //! moment.js locale configuration //! locale : Hungarian [hu] //! author : Adam Brunner : https://github.com/adambrunner +//! author : Peter Viszt : https://github.com/passatgt import moment from '../moment'; @@ -54,9 +55,10 @@ export default moment.defineLocale('hu', { months: 'január_február_március_április_május_június_július_augusztus_szeptember_október_november_december'.split( '_' ), - monthsShort: 'jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec'.split( + monthsShort: 'jan._feb._márc._ápr._máj._jún._júl._aug._szept._okt._nov._dec.'.split( '_' ), + monthsParseExact: true, weekdays: 'vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat'.split('_'), weekdaysShort: 'vas_hét_kedd_sze_csüt_pén_szo'.split('_'), weekdaysMin: 'v_h_k_sze_cs_p_szo'.split('_'), diff --git a/dist/locale/it.js b/dist/locale/it.js index a52dc98e6..46aaccfbe 100644 --- a/dist/locale/it.js +++ b/dist/locale/it.js @@ -90,6 +90,8 @@ export default moment.defineLocale('it', { hh: '%d ore', d: 'un giorno', dd: '%d giorni', + w: 'una settimana', + ww: '%d settimane', M: 'un mese', MM: '%d mesi', y: 'un anno', diff --git a/dist/locale/km.js b/dist/locale/km.js index d39187ab6..f3b127b9e 100644 --- a/dist/locale/km.js +++ b/dist/locale/km.js @@ -5,16 +5,16 @@ import moment from '../moment'; var symbolMap = { - '1': '១', - '2': '២', - '3': '៣', - '4': '៤', - '5': '៥', - '6': '៦', - '7': '៧', - '8': '៨', - '9': '៩', - '0': '០', + 1: '១', + 2: '២', + 3: '៣', + 4: '៤', + 5: '៥', + 6: '៦', + 7: '៧', + 8: '៨', + 9: '៩', + 0: '០', }, numberMap = { '១': '1', diff --git a/dist/locale/kn.js b/dist/locale/kn.js index a81c0808d..e5a8fca5e 100644 --- a/dist/locale/kn.js +++ b/dist/locale/kn.js @@ -5,16 +5,16 @@ import moment from '../moment'; var symbolMap = { - '1': '೧', - '2': '೨', - '3': '೩', - '4': '೪', - '5': '೫', - '6': '೬', - '7': '೭', - '8': '೮', - '9': '೯', - '0': '೦', + 1: '೧', + 2: '೨', + 3: '೩', + 4: '೪', + 5: '೫', + 6: '೬', + 7: '೭', + 8: '೮', + 9: '೯', + 0: '೦', }, numberMap = { '೧': '1', diff --git a/dist/locale/ku.js b/dist/locale/ku.js index 0ca7e3349..6d2673bc9 100644 --- a/dist/locale/ku.js +++ b/dist/locale/ku.js @@ -5,16 +5,16 @@ import moment from '../moment'; var symbolMap = { - '1': '١', - '2': '٢', - '3': '٣', - '4': '٤', - '5': '٥', - '6': '٦', - '7': '٧', - '8': '٨', - '9': '٩', - '0': '٠', + 1: '١', + 2: '٢', + 3: '٣', + 4: '٤', + 5: '٥', + 6: '٦', + 7: '٧', + 8: '٨', + 9: '٩', + 0: '٠', }, numberMap = { '١': '1', diff --git a/dist/locale/mr.js b/dist/locale/mr.js index f09a61e05..082c75108 100644 --- a/dist/locale/mr.js +++ b/dist/locale/mr.js @@ -6,16 +6,16 @@ import moment from '../moment'; var symbolMap = { - '1': '१', - '2': '२', - '3': '३', - '4': '४', - '5': '५', - '6': '६', - '7': '७', - '8': '८', - '9': '९', - '0': '०', + 1: '१', + 2: '२', + 3: '३', + 4: '४', + 5: '५', + 6: '६', + 7: '७', + 8: '८', + 9: '९', + 0: '०', }, numberMap = { '१': '1', diff --git a/dist/locale/my.js b/dist/locale/my.js index 1b98364ee..034b221ab 100644 --- a/dist/locale/my.js +++ b/dist/locale/my.js @@ -7,16 +7,16 @@ import moment from '../moment'; var symbolMap = { - '1': '၁', - '2': '၂', - '3': '၃', - '4': '၄', - '5': '၅', - '6': '၆', - '7': '၇', - '8': '၈', - '9': '၉', - '0': '၀', + 1: '၁', + 2: '၂', + 3: '၃', + 4: '၄', + 5: '၅', + 6: '၆', + 7: '၇', + 8: '၈', + 9: '၉', + 0: '၀', }, numberMap = { '၁': '1', diff --git a/dist/locale/nb.js b/dist/locale/nb.js index 105e04a2e..57f94c08c 100644 --- a/dist/locale/nb.js +++ b/dist/locale/nb.js @@ -45,6 +45,8 @@ export default moment.defineLocale('nb', { hh: '%d timer', d: 'en dag', dd: '%d dager', + w: 'en uke', + ww: '%d uker', M: 'en måned', MM: '%d måneder', y: 'ett år', diff --git a/dist/locale/ne.js b/dist/locale/ne.js index 6f48595dc..388753cd2 100644 --- a/dist/locale/ne.js +++ b/dist/locale/ne.js @@ -5,16 +5,16 @@ import moment from '../moment'; var symbolMap = { - '1': '१', - '2': '२', - '3': '३', - '4': '४', - '5': '५', - '6': '६', - '7': '७', - '8': '८', - '9': '९', - '0': '०', + 1: '१', + 2: '२', + 3: '३', + 4: '४', + 5: '५', + 6: '६', + 7: '७', + 8: '८', + 9: '९', + 0: '०', }, numberMap = { '१': '1', diff --git a/dist/locale/nl.js b/dist/locale/nl.js index 711d511a1..44e16b51a 100644 --- a/dist/locale/nl.js +++ b/dist/locale/nl.js @@ -83,6 +83,8 @@ export default moment.defineLocale('nl', { hh: '%d uur', d: 'één dag', dd: '%d dagen', + w: 'één week', + ww: '%d weken', M: 'één maand', MM: '%d maanden', y: 'één jaar', diff --git a/dist/locale/nn.js b/dist/locale/nn.js index f2a58f2f6..e6ae6bbdd 100644 --- a/dist/locale/nn.js +++ b/dist/locale/nn.js @@ -44,6 +44,8 @@ export default moment.defineLocale('nn', { hh: '%d timar', d: 'ein dag', dd: '%d dagar', + w: 'ei veke', + ww: '%d veker', M: 'ein månad', MM: '%d månader', y: 'eit år', diff --git a/dist/locale/pa-in.js b/dist/locale/pa-in.js index 5143223d1..6ad501d3d 100644 --- a/dist/locale/pa-in.js +++ b/dist/locale/pa-in.js @@ -5,16 +5,16 @@ import moment from '../moment'; var symbolMap = { - '1': '੧', - '2': '੨', - '3': '੩', - '4': '੪', - '5': '੫', - '6': '੬', - '7': '੭', - '8': '੮', - '9': '੯', - '0': '੦', + 1: '੧', + 2: '੨', + 3: '੩', + 4: '੪', + 5: '੫', + 6: '੬', + 7: '੭', + 8: '੮', + 9: '੯', + 0: '੦', }, numberMap = { '੧': '1', diff --git a/dist/locale/pl.js b/dist/locale/pl.js index 079118a8f..5a1de6444 100644 --- a/dist/locale/pl.js +++ b/dist/locale/pl.js @@ -9,7 +9,21 @@ var monthsNominative = 'styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierp ), monthsSubjective = 'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia'.split( '_' - ); + ), + monthsParse = [ + /^sty/i, + /^lut/i, + /^mar/i, + /^kwi/i, + /^maj/i, + /^cze/i, + /^lip/i, + /^sie/i, + /^wrz/i, + /^paź/i, + /^lis/i, + /^gru/i, + ]; function plural(n) { return n % 10 < 5 && n % 10 > 1 && ~~(n / 10) % 10 !== 1; } @@ -26,6 +40,8 @@ function translate(number, withoutSuffix, key) { return withoutSuffix ? 'godzina' : 'godzinę'; case 'hh': return result + (plural(number) ? 'godziny' : 'godzin'); + case 'ww': + return result + (plural(number) ? 'tygodnie' : 'tygodni'); case 'MM': return result + (plural(number) ? 'miesiące' : 'miesięcy'); case 'yy': @@ -37,17 +53,6 @@ export default moment.defineLocale('pl', { months: function (momentToFormat, format) { if (!momentToFormat) { return monthsNominative; - } else if (format === '') { - // Hack: if format empty we know this is used to generate - // RegExp by moment. Give then back both valid forms of months - // in RegExp ready format. - return ( - '(' + - monthsSubjective[momentToFormat.month()] + - '|' + - monthsNominative[momentToFormat.month()] + - ')' - ); } else if (/D MMMM/.test(format)) { return monthsSubjective[momentToFormat.month()]; } else { @@ -55,6 +60,9 @@ export default moment.defineLocale('pl', { } }, monthsShort: 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'), + monthsParse: monthsParse, + longMonthsParse: monthsParse, + shortMonthsParse: monthsParse, weekdays: 'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split( '_' ), @@ -115,6 +123,8 @@ export default moment.defineLocale('pl', { hh: translate, d: '1 dzień', dd: '%d dni', + w: 'tydzień', + ww: translate, M: 'miesiąc', MM: translate, y: 'rok', diff --git a/dist/locale/pt-br.js b/dist/locale/pt-br.js index 9a1266129..36413b37b 100644 --- a/dist/locale/pt-br.js +++ b/dist/locale/pt-br.js @@ -53,4 +53,5 @@ export default moment.defineLocale('pt-br', { }, dayOfMonthOrdinalParse: /\d{1,2}º/, ordinal: '%dº', + invalidDate: 'Data inválida', }); diff --git a/dist/locale/pt.js b/dist/locale/pt.js index 0a5761c64..97d4c972f 100644 --- a/dist/locale/pt.js +++ b/dist/locale/pt.js @@ -46,6 +46,8 @@ export default moment.defineLocale('pt', { hh: '%d horas', d: 'um dia', dd: '%d dias', + w: 'uma semana', + ww: '%d semanas', M: 'um mês', MM: '%d meses', y: 'um ano', diff --git a/dist/locale/ro.js b/dist/locale/ro.js index fd8f50c10..8a5941aba 100644 --- a/dist/locale/ro.js +++ b/dist/locale/ro.js @@ -12,6 +12,7 @@ function relativeTimeWithPlural(number, withoutSuffix, key) { mm: 'minute', hh: 'ore', dd: 'zile', + ww: 'săptămâni', MM: 'luni', yy: 'ani', }, @@ -60,6 +61,8 @@ export default moment.defineLocale('ro', { hh: relativeTimeWithPlural, d: 'o zi', dd: relativeTimeWithPlural, + w: 'o săptămână', + ww: relativeTimeWithPlural, M: 'o lună', MM: relativeTimeWithPlural, y: 'un an', diff --git a/dist/locale/ru.js b/dist/locale/ru.js index b92059c39..0c189ebfb 100644 --- a/dist/locale/ru.js +++ b/dist/locale/ru.js @@ -20,6 +20,7 @@ function relativeTimeWithPlural(number, withoutSuffix, key) { mm: withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут', hh: 'час_часа_часов', dd: 'день_дня_дней', + ww: 'неделя_недели_недель', MM: 'месяц_месяца_месяцев', yy: 'год_года_лет', }; @@ -160,6 +161,8 @@ export default moment.defineLocale('ru', { hh: relativeTimeWithPlural, d: 'день', dd: relativeTimeWithPlural, + w: 'неделя', + ww: relativeTimeWithPlural, M: 'месяц', MM: relativeTimeWithPlural, y: 'год', diff --git a/dist/locale/sr-cyrl.js b/dist/locale/sr-cyrl.js index 052f96036..5f695972a 100644 --- a/dist/locale/sr-cyrl.js +++ b/dist/locale/sr-cyrl.js @@ -1,6 +1,7 @@ //! moment.js locale configuration //! locale : Serbian Cyrillic [sr-cyrl] //! author : Milan Janačković : https://github.com/milan-j +//! author : Stefan Crnjaković : https://github.com/crnjakovic import moment from '../moment'; @@ -52,10 +53,10 @@ export default moment.defineLocale('sr-cyrl', { longDateFormat: { LT: 'H:mm', LTS: 'H:mm:ss', - L: 'DD.MM.YYYY', - LL: 'D. MMMM YYYY', - LLL: 'D. MMMM YYYY H:mm', - LLLL: 'dddd, D. MMMM YYYY H:mm', + L: 'D. M. YYYY.', + LL: 'D. MMMM YYYY.', + LLL: 'D. MMMM YYYY. H:mm', + LLLL: 'dddd, D. MMMM YYYY. H:mm', }, calendar: { sameDay: '[данас у] LT', @@ -110,6 +111,6 @@ export default moment.defineLocale('sr-cyrl', { ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. - doy: 7, // The week that contains Jan 7th is the first week of the year. + doy: 7, // The week that contains Jan 1st is the first week of the year. }, }); diff --git a/dist/locale/sr.js b/dist/locale/sr.js index 08f6adbe0..502b54d8d 100644 --- a/dist/locale/sr.js +++ b/dist/locale/sr.js @@ -1,6 +1,7 @@ //! moment.js locale configuration //! locale : Serbian [sr] //! author : Milan Janačković : https://github.com/milan-j +//! author : Stefan Crnjaković : https://github.com/crnjakovic import moment from '../moment'; @@ -54,10 +55,10 @@ export default moment.defineLocale('sr', { longDateFormat: { LT: 'H:mm', LTS: 'H:mm:ss', - L: 'DD.MM.YYYY', - LL: 'D. MMMM YYYY', - LLL: 'D. MMMM YYYY H:mm', - LLLL: 'dddd, D. MMMM YYYY H:mm', + L: 'D. M. YYYY.', + LL: 'D. MMMM YYYY.', + LLL: 'D. MMMM YYYY. H:mm', + LLLL: 'dddd, D. MMMM YYYY. H:mm', }, calendar: { sameDay: '[danas u] LT', diff --git a/dist/locale/ta.js b/dist/locale/ta.js index ea7f11f52..16758584d 100644 --- a/dist/locale/ta.js +++ b/dist/locale/ta.js @@ -5,16 +5,16 @@ import moment from '../moment'; var symbolMap = { - '1': '௧', - '2': '௨', - '3': '௩', - '4': '௪', - '5': '௫', - '6': '௬', - '7': '௭', - '8': '௮', - '9': '௯', - '0': '௦', + 1: '௧', + 2: '௨', + 3: '௩', + 4: '௪', + 5: '௫', + 6: '௬', + 7: '௭', + 8: '௮', + 9: '௯', + 0: '௦', }, numberMap = { '௧': '1', diff --git a/dist/locale/tg.js b/dist/locale/tg.js index 4fd4a2d29..9dfe50506 100644 --- a/dist/locale/tg.js +++ b/dist/locale/tg.js @@ -30,9 +30,14 @@ var suffixes = { }; export default moment.defineLocale('tg', { - months: 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split( - '_' - ), + months: { + format: 'январи_феврали_марти_апрели_майи_июни_июли_августи_сентябри_октябри_ноябри_декабри'.split( + '_' + ), + standalone: 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split( + '_' + ), + }, monthsShort: 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'), weekdays: 'якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе'.split( '_' @@ -42,14 +47,14 @@ export default moment.defineLocale('tg', { longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', - L: 'DD/MM/YYYY', + L: 'DD.MM.YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd, D MMMM YYYY HH:mm', }, calendar: { sameDay: '[Имрӯз соати] LT', - nextDay: '[Пагоҳ соати] LT', + nextDay: '[Фардо соати] LT', lastDay: '[Дирӯз соати] LT', nextWeek: 'dddd[и] [ҳафтаи оянда соати] LT', lastWeek: 'dddd[и] [ҳафтаи гузашта соати] LT', diff --git a/dist/locale/th.js b/dist/locale/th.js index 1983820d2..2d68a28d1 100644 --- a/dist/locale/th.js +++ b/dist/locale/th.js @@ -54,6 +54,8 @@ export default moment.defineLocale('th', { hh: '%d ชั่วโมง', d: '1 วัน', dd: '%d วัน', + w: '1 สัปดาห์', + ww: '%d สัปดาห์', M: '1 เดือน', MM: '%d เดือน', y: '1 ปี', diff --git a/dist/locale/tr.js b/dist/locale/tr.js index a5cf34377..73a253440 100644 --- a/dist/locale/tr.js +++ b/dist/locale/tr.js @@ -74,6 +74,8 @@ export default moment.defineLocale('tr', { hh: '%d saat', d: 'bir gün', dd: '%d gün', + w: 'bir hafta', + ww: '%d hafta', M: 'bir ay', MM: '%d ay', y: 'bir yıl', diff --git a/dist/locale/vi.js b/dist/locale/vi.js index a3876093d..afec9422c 100644 --- a/dist/locale/vi.js +++ b/dist/locale/vi.js @@ -61,6 +61,8 @@ export default moment.defineLocale('vi', { hh: '%d giờ', d: 'một ngày', dd: '%d ngày', + w: 'một tuần', + ww: '%d tuần', M: 'một tháng', MM: '%d tháng', y: 'một năm', diff --git a/dist/locale/zh-cn.js b/dist/locale/zh-cn.js index ca7dee996..2345ee6c1 100644 --- a/dist/locale/zh-cn.js +++ b/dist/locale/zh-cn.js @@ -105,6 +105,8 @@ export default moment.defineLocale('zh-cn', { hh: '%d 小时', d: '1 天', dd: '%d 天', + w: '1 周', + ww: '%d 周', M: '1 个月', MM: '%d 个月', y: '1 年', diff --git a/dist/moment.js b/dist/moment.js index 9289cfe64..0f6e2018c 100644 --- a/dist/moment.js +++ b/dist/moment.js @@ -1,5 +1,5 @@ //! moment.js -//! version : 2.28.0 +//! version : 2.29.0 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com @@ -3720,7 +3720,10 @@ function getCalendarFormat(myMoment, now) { function calendar$1(time, formats) { // Support for single parameter, formats only overload to the calendar function if (arguments.length === 1) { - if (isMomentInput(arguments[0])) { + if (!arguments[0]) { + time = undefined; + formats = undefined; + } else if (isMomentInput(arguments[0])) { time = arguments[0]; formats = undefined; } else if (isCalendarSpec(arguments[0])) { @@ -5612,7 +5615,7 @@ addParseToken('x', function (input, array, config) { //! moment.js -hooks.version = '2.28.0'; +hooks.version = '2.29.0'; setHookCallback(createLocal); diff --git a/locale/ar-ly.js b/locale/ar-ly.js index 276a02e6c..68309343c 100644 --- a/locale/ar-ly.js +++ b/locale/ar-ly.js @@ -12,16 +12,16 @@ //! moment.js locale configuration var symbolMap = { - '1': '1', - '2': '2', - '3': '3', - '4': '4', - '5': '5', - '6': '6', - '7': '7', - '8': '8', - '9': '9', - '0': '0', + 1: '1', + 2: '2', + 3: '3', + 4: '4', + 5: '5', + 6: '6', + 7: '7', + 8: '8', + 9: '9', + 0: '0', }, pluralForm = function (n) { return n === 0 diff --git a/locale/ar-ma.js b/locale/ar-ma.js index c21e1f6c3..16747bfc4 100644 --- a/locale/ar-ma.js +++ b/locale/ar-ma.js @@ -56,8 +56,8 @@ yy: '%d سنوات', }, week: { - dow: 6, // Saturday is the first day of the week. - doy: 12, // The week that contains Jan 12th is the first week of the year. + dow: 1, // Monday is the first day of the week. + doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); diff --git a/locale/ar-sa.js b/locale/ar-sa.js index 44f9ff9be..9426d1636 100644 --- a/locale/ar-sa.js +++ b/locale/ar-sa.js @@ -12,16 +12,16 @@ //! moment.js locale configuration var symbolMap = { - '1': '١', - '2': '٢', - '3': '٣', - '4': '٤', - '5': '٥', - '6': '٦', - '7': '٧', - '8': '٨', - '9': '٩', - '0': '٠', + 1: '١', + 2: '٢', + 3: '٣', + 4: '٤', + 5: '٥', + 6: '٦', + 7: '٧', + 8: '٨', + 9: '٩', + 0: '٠', }, numberMap = { '١': '1', diff --git a/locale/ar.js b/locale/ar.js index 4c3e041ed..7394244eb 100644 --- a/locale/ar.js +++ b/locale/ar.js @@ -14,16 +14,16 @@ //! moment.js locale configuration var symbolMap = { - '1': '١', - '2': '٢', - '3': '٣', - '4': '٤', - '5': '٥', - '6': '٦', - '7': '٧', - '8': '٨', - '9': '٩', - '0': '٠', + 1: '١', + 2: '٢', + 3: '٣', + 4: '٤', + 5: '٥', + 6: '٦', + 7: '٧', + 8: '٨', + 9: '٩', + 0: '٠', }, numberMap = { '١': '1', diff --git a/locale/bg.js b/locale/bg.js index 05b6cf8ed..5a1bda825 100644 --- a/locale/bg.js +++ b/locale/bg.js @@ -60,6 +60,8 @@ hh: '%d часа', d: 'ден', dd: '%d дена', + w: 'седмица', + ww: '%d седмици', M: 'месец', MM: '%d месеца', y: 'година', diff --git a/locale/bn-bd.js b/locale/bn-bd.js new file mode 100644 index 000000000..24f42cdb8 --- /dev/null +++ b/locale/bn-bd.js @@ -0,0 +1,139 @@ +//! moment.js locale configuration +//! locale : Bengali (Bangladesh) [bn-bd] +//! author : Asraf Hossain Patoary : https://github.com/ashwoolford + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, (function (moment) { 'use strict'; + + //! moment.js locale configuration + + var symbolMap = { + 1: '১', + 2: '২', + 3: '৩', + 4: '৪', + 5: '৫', + 6: '৬', + 7: '৭', + 8: '৮', + 9: '৯', + 0: '০', + }, + numberMap = { + '১': '1', + '২': '2', + '৩': '3', + '৪': '4', + '৫': '5', + '৬': '6', + '৭': '7', + '৮': '8', + '৯': '9', + '০': '0', + }; + + var bnBd = moment.defineLocale('bn-bd', { + months: 'জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split( + '_' + ), + monthsShort: 'জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে'.split( + '_' + ), + weekdays: 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার'.split( + '_' + ), + weekdaysShort: 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি'.split('_'), + weekdaysMin: 'রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি'.split('_'), + longDateFormat: { + LT: 'A h:mm সময়', + LTS: 'A h:mm:ss সময়', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY, A h:mm সময়', + LLLL: 'dddd, D MMMM YYYY, A h:mm সময়', + }, + calendar: { + sameDay: '[আজ] LT', + nextDay: '[আগামীকাল] LT', + nextWeek: 'dddd, LT', + lastDay: '[গতকাল] LT', + lastWeek: '[গত] dddd, LT', + sameElse: 'L', + }, + relativeTime: { + future: '%s পরে', + past: '%s আগে', + s: 'কয়েক সেকেন্ড', + ss: '%d সেকেন্ড', + m: 'এক মিনিট', + mm: '%d মিনিট', + h: 'এক ঘন্টা', + hh: '%d ঘন্টা', + d: 'এক দিন', + dd: '%d দিন', + M: 'এক মাস', + MM: '%d মাস', + y: 'এক বছর', + yy: '%d বছর', + }, + preparse: function (string) { + return string.replace(/[১২৩৪৫৬৭৮৯০]/g, function (match) { + return numberMap[match]; + }); + }, + postformat: function (string) { + return string.replace(/\d/g, function (match) { + return symbolMap[match]; + }); + }, + + meridiemParse: /রাত|ভোর|সকাল|দুপুর|বিকাল|সন্ধ্যা|রাত/, + meridiemHour: function (hour, meridiem) { + if (hour === 12) { + hour = 0; + } + if (meridiem === 'রাত') { + return hour < 4 ? hour : hour + 12; + } else if (meridiem === 'ভোর') { + return hour; + } else if (meridiem === 'সকাল') { + return hour; + } else if (meridiem === 'দুপুর') { + return hour >= 3 ? hour : hour + 12; + } else if (meridiem === 'বিকাল') { + return hour + 12; + } else if (meridiem === 'সন্ধ্যা') { + return hour + 12; + } + }, + + meridiem: function (hour, minute, isLower) { + if (hour < 4) { + return 'রাত'; + } else if (hour < 6) { + return 'ভোর'; + } else if (hour < 12) { + return 'সকাল'; + } else if (hour < 15) { + return 'দুপুর'; + } else if (hour < 18) { + return 'বিকাল'; + } else if (hour < 20) { + return 'সন্ধ্যা'; + } else { + return 'রাত'; + } + }, + week: { + dow: 0, // Sunday is the first day of the week. + doy: 6, // The week that contains Jan 6th is the first week of the year. + }, + }); + + return bnBd; + +}))); diff --git a/locale/bn.js b/locale/bn.js index e97f0f61d..1d00ee84b 100644 --- a/locale/bn.js +++ b/locale/bn.js @@ -12,16 +12,16 @@ //! moment.js locale configuration var symbolMap = { - '1': '১', - '2': '২', - '3': '৩', - '4': '৪', - '5': '৫', - '6': '৬', - '7': '৭', - '8': '৮', - '9': '৯', - '0': '০', + 1: '১', + 2: '২', + 3: '৩', + 4: '৪', + 5: '৫', + 6: '৬', + 7: '৭', + 8: '৮', + 9: '৯', + 0: '০', }, numberMap = { '১': '1', diff --git a/locale/bo.js b/locale/bo.js index 1b514e4b9..8a48562dd 100644 --- a/locale/bo.js +++ b/locale/bo.js @@ -12,16 +12,16 @@ //! moment.js locale configuration var symbolMap = { - '1': '༡', - '2': '༢', - '3': '༣', - '4': '༤', - '5': '༥', - '6': '༦', - '7': '༧', - '8': '༨', - '9': '༩', - '0': '༠', + 1: '༡', + 2: '༢', + 3: '༣', + 4: '༤', + 5: '༥', + 6: '༦', + 7: '༧', + 8: '༨', + 9: '༩', + 0: '༠', }, numberMap = { '༡': '1', diff --git a/locale/es-do.js b/locale/es-do.js index d550f1130..3d6c8eca3 100644 --- a/locale/es-do.js +++ b/locale/es-do.js @@ -95,6 +95,8 @@ hh: '%d horas', d: 'un día', dd: '%d días', + w: 'una semana', + ww: '%d semanas', M: 'un mes', MM: '%d meses', y: 'un año', diff --git a/locale/es-mx.js b/locale/es-mx.js new file mode 100644 index 000000000..5070e341c --- /dev/null +++ b/locale/es-mx.js @@ -0,0 +1,117 @@ +//! moment.js locale configuration +//! locale : Spanish (Mexico) [es-mx] +//! author : JC Franco : https://github.com/jcfranco + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, (function (moment) { 'use strict'; + + //! moment.js locale configuration + + var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split( + '_' + ), + monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'), + monthsParse = [ + /^ene/i, + /^feb/i, + /^mar/i, + /^abr/i, + /^may/i, + /^jun/i, + /^jul/i, + /^ago/i, + /^sep/i, + /^oct/i, + /^nov/i, + /^dic/i, + ], + monthsRegex = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i; + + var esMx = moment.defineLocale('es-mx', { + months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split( + '_' + ), + monthsShort: function (m, format) { + if (!m) { + return monthsShortDot; + } else if (/-MMM-/.test(format)) { + return monthsShort[m.month()]; + } else { + return monthsShortDot[m.month()]; + } + }, + monthsRegex: monthsRegex, + monthsShortRegex: monthsRegex, + monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i, + monthsShortStrictRegex: /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i, + monthsParse: monthsParse, + longMonthsParse: monthsParse, + shortMonthsParse: monthsParse, + weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'), + weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'), + weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'), + weekdaysParseExact: true, + longDateFormat: { + LT: 'H:mm', + LTS: 'H:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D [de] MMMM [de] YYYY', + LLL: 'D [de] MMMM [de] YYYY H:mm', + LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm', + }, + calendar: { + sameDay: function () { + return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; + }, + nextDay: function () { + return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; + }, + nextWeek: function () { + return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; + }, + lastDay: function () { + return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; + }, + lastWeek: function () { + return ( + '[el] dddd [pasado a la' + + (this.hours() !== 1 ? 's' : '') + + '] LT' + ); + }, + sameElse: 'L', + }, + relativeTime: { + future: 'en %s', + past: 'hace %s', + s: 'unos segundos', + ss: '%d segundos', + m: 'un minuto', + mm: '%d minutos', + h: 'una hora', + hh: '%d horas', + d: 'un día', + dd: '%d días', + w: 'una semana', + ww: '%d semanas', + M: 'un mes', + MM: '%d meses', + y: 'un año', + yy: '%d años', + }, + dayOfMonthOrdinalParse: /\d{1,2}º/, + ordinal: '%dº', + week: { + dow: 0, // Sunday is the first day of the week. + doy: 4, // The week that contains Jan 4th is the first week of the year. + }, + invalidDate: 'Fecha inválida', + }); + + return esMx; + +}))); diff --git a/locale/es-us.js b/locale/es-us.js index c0207eb02..127b8fa0d 100644 --- a/locale/es-us.js +++ b/locale/es-us.js @@ -97,6 +97,8 @@ hh: '%d horas', d: 'un día', dd: '%d días', + w: 'una semana', + ww: '%d semanas', M: 'un mes', MM: '%d meses', y: 'un año', diff --git a/locale/es.js b/locale/es.js index 05d59d841..87f378084 100644 --- a/locale/es.js +++ b/locale/es.js @@ -96,6 +96,8 @@ hh: '%d horas', d: 'un día', dd: '%d días', + w: 'una semana', + ww: '%d semanas', M: 'un mes', MM: '%d meses', y: 'un año', diff --git a/locale/fa.js b/locale/fa.js index fff48cf70..8a4458b47 100644 --- a/locale/fa.js +++ b/locale/fa.js @@ -12,16 +12,16 @@ //! moment.js locale configuration var symbolMap = { - '1': '۱', - '2': '۲', - '3': '۳', - '4': '۴', - '5': '۵', - '6': '۶', - '7': '۷', - '8': '۸', - '9': '۹', - '0': '۰', + 1: '۱', + 2: '۲', + 3: '۳', + 4: '۴', + 5: '۵', + 6: '۶', + 7: '۷', + 8: '۸', + 9: '۹', + 0: '۰', }, numberMap = { '۱': '1', diff --git a/locale/fr.js b/locale/fr.js index e55d83188..61014d88a 100644 --- a/locale/fr.js +++ b/locale/fr.js @@ -74,6 +74,8 @@ hh: '%d heures', d: 'un jour', dd: '%d jours', + w: 'une semaine', + ww: '%d semaines', M: 'un mois', MM: '%d mois', y: 'un an', diff --git a/locale/gu.js b/locale/gu.js index cf7389b45..fef72b530 100644 --- a/locale/gu.js +++ b/locale/gu.js @@ -12,16 +12,16 @@ //! moment.js locale configuration var symbolMap = { - '1': '૧', - '2': '૨', - '3': '૩', - '4': '૪', - '5': '૫', - '6': '૬', - '7': '૭', - '8': '૮', - '9': '૯', - '0': '૦', + 1: '૧', + 2: '૨', + 3: '૩', + 4: '૪', + 5: '૫', + 6: '૬', + 7: '૭', + 8: '૮', + 9: '૯', + 0: '૦', }, numberMap = { '૧': '1', diff --git a/locale/hi.js b/locale/hi.js index 3615f4d09..4b971c0ae 100644 --- a/locale/hi.js +++ b/locale/hi.js @@ -12,16 +12,16 @@ //! moment.js locale configuration var symbolMap = { - '1': '१', - '2': '२', - '3': '३', - '4': '४', - '5': '५', - '6': '६', - '7': '७', - '8': '८', - '9': '९', - '0': '०', + 1: '१', + 2: '२', + 3: '३', + 4: '४', + 5: '५', + 6: '६', + 7: '७', + 8: '८', + 9: '९', + 0: '०', }, numberMap = { '१': '1', diff --git a/locale/hu.js b/locale/hu.js index 3a6685c94..fc51a93ca 100644 --- a/locale/hu.js +++ b/locale/hu.js @@ -1,6 +1,7 @@ //! moment.js locale configuration //! locale : Hungarian [hu] //! author : Adam Brunner : https://github.com/adambrunner +//! author : Peter Viszt : https://github.com/passatgt ;(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' @@ -61,9 +62,10 @@ months: 'január_február_március_április_május_június_július_augusztus_szeptember_október_november_december'.split( '_' ), - monthsShort: 'jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec'.split( + monthsShort: 'jan._feb._márc._ápr._máj._jún._júl._aug._szept._okt._nov._dec.'.split( '_' ), + monthsParseExact: true, weekdays: 'vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat'.split('_'), weekdaysShort: 'vas_hét_kedd_sze_csüt_pén_szo'.split('_'), weekdaysMin: 'v_h_k_sze_cs_p_szo'.split('_'), diff --git a/locale/it.js b/locale/it.js index 7ec973797..2ac903775 100644 --- a/locale/it.js +++ b/locale/it.js @@ -97,6 +97,8 @@ hh: '%d ore', d: 'un giorno', dd: '%d giorni', + w: 'una settimana', + ww: '%d settimane', M: 'un mese', MM: '%d mesi', y: 'un anno', diff --git a/locale/km.js b/locale/km.js index a4457886d..dc58b10b5 100644 --- a/locale/km.js +++ b/locale/km.js @@ -12,16 +12,16 @@ //! moment.js locale configuration var symbolMap = { - '1': '១', - '2': '២', - '3': '៣', - '4': '៤', - '5': '៥', - '6': '៦', - '7': '៧', - '8': '៨', - '9': '៩', - '0': '០', + 1: '១', + 2: '២', + 3: '៣', + 4: '៤', + 5: '៥', + 6: '៦', + 7: '៧', + 8: '៨', + 9: '៩', + 0: '០', }, numberMap = { '១': '1', diff --git a/locale/kn.js b/locale/kn.js index 84ff9b83e..2b7cd4e53 100644 --- a/locale/kn.js +++ b/locale/kn.js @@ -12,16 +12,16 @@ //! moment.js locale configuration var symbolMap = { - '1': '೧', - '2': '೨', - '3': '೩', - '4': '೪', - '5': '೫', - '6': '೬', - '7': '೭', - '8': '೮', - '9': '೯', - '0': '೦', + 1: '೧', + 2: '೨', + 3: '೩', + 4: '೪', + 5: '೫', + 6: '೬', + 7: '೭', + 8: '೮', + 9: '೯', + 0: '೦', }, numberMap = { '೧': '1', diff --git a/locale/ku.js b/locale/ku.js index 2c4f7e28f..4c2712103 100644 --- a/locale/ku.js +++ b/locale/ku.js @@ -12,16 +12,16 @@ //! moment.js locale configuration var symbolMap = { - '1': '١', - '2': '٢', - '3': '٣', - '4': '٤', - '5': '٥', - '6': '٦', - '7': '٧', - '8': '٨', - '9': '٩', - '0': '٠', + 1: '١', + 2: '٢', + 3: '٣', + 4: '٤', + 5: '٥', + 6: '٦', + 7: '٧', + 8: '٨', + 9: '٩', + 0: '٠', }, numberMap = { '١': '1', diff --git a/locale/mr.js b/locale/mr.js index 84f4e6454..833dfe126 100644 --- a/locale/mr.js +++ b/locale/mr.js @@ -13,16 +13,16 @@ //! moment.js locale configuration var symbolMap = { - '1': '१', - '2': '२', - '3': '३', - '4': '४', - '5': '५', - '6': '६', - '7': '७', - '8': '८', - '9': '९', - '0': '०', + 1: '१', + 2: '२', + 3: '३', + 4: '४', + 5: '५', + 6: '६', + 7: '७', + 8: '८', + 9: '९', + 0: '०', }, numberMap = { '१': '1', diff --git a/locale/my.js b/locale/my.js index 77be4fee8..c1ef2dff5 100644 --- a/locale/my.js +++ b/locale/my.js @@ -14,16 +14,16 @@ //! moment.js locale configuration var symbolMap = { - '1': '၁', - '2': '၂', - '3': '၃', - '4': '၄', - '5': '၅', - '6': '၆', - '7': '၇', - '8': '၈', - '9': '၉', - '0': '၀', + 1: '၁', + 2: '၂', + 3: '၃', + 4: '၄', + 5: '၅', + 6: '၆', + 7: '၇', + 8: '၈', + 9: '၉', + 0: '၀', }, numberMap = { '၁': '1', diff --git a/locale/nb.js b/locale/nb.js index 0138f0953..ec342b2d7 100644 --- a/locale/nb.js +++ b/locale/nb.js @@ -52,6 +52,8 @@ hh: '%d timer', d: 'en dag', dd: '%d dager', + w: 'en uke', + ww: '%d uker', M: 'en måned', MM: '%d måneder', y: 'ett år', diff --git a/locale/ne.js b/locale/ne.js index e2c737eab..703dbabb5 100644 --- a/locale/ne.js +++ b/locale/ne.js @@ -12,16 +12,16 @@ //! moment.js locale configuration var symbolMap = { - '1': '१', - '2': '२', - '3': '३', - '4': '४', - '5': '५', - '6': '६', - '7': '७', - '8': '८', - '9': '९', - '0': '०', + 1: '१', + 2: '२', + 3: '३', + 4: '४', + 5: '५', + 6: '६', + 7: '७', + 8: '८', + 9: '९', + 0: '०', }, numberMap = { '१': '1', diff --git a/locale/nl.js b/locale/nl.js index bc6dac757..4876e881c 100644 --- a/locale/nl.js +++ b/locale/nl.js @@ -90,6 +90,8 @@ hh: '%d uur', d: 'één dag', dd: '%d dagen', + w: 'één week', + ww: '%d weken', M: 'één maand', MM: '%d maanden', y: 'één jaar', diff --git a/locale/nn.js b/locale/nn.js index 638cefb92..a2fbe9b26 100644 --- a/locale/nn.js +++ b/locale/nn.js @@ -51,6 +51,8 @@ hh: '%d timar', d: 'ein dag', dd: '%d dagar', + w: 'ei veke', + ww: '%d veker', M: 'ein månad', MM: '%d månader', y: 'eit år', diff --git a/locale/pa-in.js b/locale/pa-in.js index ff01b87ff..bc538d19f 100644 --- a/locale/pa-in.js +++ b/locale/pa-in.js @@ -12,16 +12,16 @@ //! moment.js locale configuration var symbolMap = { - '1': '੧', - '2': '੨', - '3': '੩', - '4': '੪', - '5': '੫', - '6': '੬', - '7': '੭', - '8': '੮', - '9': '੯', - '0': '੦', + 1: '੧', + 2: '੨', + 3: '੩', + 4: '੪', + 5: '੫', + 6: '੬', + 7: '੭', + 8: '੮', + 9: '੯', + 0: '੦', }, numberMap = { '੧': '1', diff --git a/locale/pl.js b/locale/pl.js index 1d2b5f29e..77daa7c0e 100644 --- a/locale/pl.js +++ b/locale/pl.js @@ -16,7 +16,21 @@ ), monthsSubjective = 'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia'.split( '_' - ); + ), + monthsParse = [ + /^sty/i, + /^lut/i, + /^mar/i, + /^kwi/i, + /^maj/i, + /^cze/i, + /^lip/i, + /^sie/i, + /^wrz/i, + /^paź/i, + /^lis/i, + /^gru/i, + ]; function plural(n) { return n % 10 < 5 && n % 10 > 1 && ~~(n / 10) % 10 !== 1; } @@ -33,6 +47,8 @@ return withoutSuffix ? 'godzina' : 'godzinę'; case 'hh': return result + (plural(number) ? 'godziny' : 'godzin'); + case 'ww': + return result + (plural(number) ? 'tygodnie' : 'tygodni'); case 'MM': return result + (plural(number) ? 'miesiące' : 'miesięcy'); case 'yy': @@ -44,17 +60,6 @@ months: function (momentToFormat, format) { if (!momentToFormat) { return monthsNominative; - } else if (format === '') { - // Hack: if format empty we know this is used to generate - // RegExp by moment. Give then back both valid forms of months - // in RegExp ready format. - return ( - '(' + - monthsSubjective[momentToFormat.month()] + - '|' + - monthsNominative[momentToFormat.month()] + - ')' - ); } else if (/D MMMM/.test(format)) { return monthsSubjective[momentToFormat.month()]; } else { @@ -62,6 +67,9 @@ } }, monthsShort: 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'), + monthsParse: monthsParse, + longMonthsParse: monthsParse, + shortMonthsParse: monthsParse, weekdays: 'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split( '_' ), @@ -122,6 +130,8 @@ hh: translate, d: '1 dzień', dd: '%d dni', + w: 'tydzień', + ww: translate, M: 'miesiąc', MM: translate, y: 'rok', diff --git a/locale/pt-br.js b/locale/pt-br.js index d903b7231..0a29a391d 100644 --- a/locale/pt-br.js +++ b/locale/pt-br.js @@ -60,6 +60,7 @@ }, dayOfMonthOrdinalParse: /\d{1,2}º/, ordinal: '%dº', + invalidDate: 'Data inválida', }); return ptBr; diff --git a/locale/pt.js b/locale/pt.js index 6d6bd869f..2be68a4f1 100644 --- a/locale/pt.js +++ b/locale/pt.js @@ -53,6 +53,8 @@ hh: '%d horas', d: 'um dia', dd: '%d dias', + w: 'uma semana', + ww: '%d semanas', M: 'um mês', MM: '%d meses', y: 'um ano', diff --git a/locale/ro.js b/locale/ro.js index ae846ef46..569ef08a8 100644 --- a/locale/ro.js +++ b/locale/ro.js @@ -19,6 +19,7 @@ mm: 'minute', hh: 'ore', dd: 'zile', + ww: 'săptămâni', MM: 'luni', yy: 'ani', }, @@ -67,6 +68,8 @@ hh: relativeTimeWithPlural, d: 'o zi', dd: relativeTimeWithPlural, + w: 'o săptămână', + ww: relativeTimeWithPlural, M: 'o lună', MM: relativeTimeWithPlural, y: 'un an', diff --git a/locale/ru.js b/locale/ru.js index 461398606..457a14562 100644 --- a/locale/ru.js +++ b/locale/ru.js @@ -27,6 +27,7 @@ mm: withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут', hh: 'час_часа_часов', dd: 'день_дня_дней', + ww: 'неделя_недели_недель', MM: 'месяц_месяца_месяцев', yy: 'год_года_лет', }; @@ -167,6 +168,8 @@ hh: relativeTimeWithPlural, d: 'день', dd: relativeTimeWithPlural, + w: 'неделя', + ww: relativeTimeWithPlural, M: 'месяц', MM: relativeTimeWithPlural, y: 'год', diff --git a/locale/sr-cyrl.js b/locale/sr-cyrl.js index 14d47b250..f2dc124d8 100644 --- a/locale/sr-cyrl.js +++ b/locale/sr-cyrl.js @@ -1,6 +1,7 @@ //! moment.js locale configuration //! locale : Serbian Cyrillic [sr-cyrl] //! author : Milan Janačković : https://github.com/milan-j +//! author : Stefan Crnjaković : https://github.com/crnjakovic ;(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' @@ -59,10 +60,10 @@ longDateFormat: { LT: 'H:mm', LTS: 'H:mm:ss', - L: 'DD.MM.YYYY', - LL: 'D. MMMM YYYY', - LLL: 'D. MMMM YYYY H:mm', - LLLL: 'dddd, D. MMMM YYYY H:mm', + L: 'D. M. YYYY.', + LL: 'D. MMMM YYYY.', + LLL: 'D. MMMM YYYY. H:mm', + LLLL: 'dddd, D. MMMM YYYY. H:mm', }, calendar: { sameDay: '[данас у] LT', @@ -117,7 +118,7 @@ ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. - doy: 7, // The week that contains Jan 7th is the first week of the year. + doy: 7, // The week that contains Jan 1st is the first week of the year. }, }); diff --git a/locale/sr.js b/locale/sr.js index 8cf996e6a..99597fc70 100644 --- a/locale/sr.js +++ b/locale/sr.js @@ -1,6 +1,7 @@ //! moment.js locale configuration //! locale : Serbian [sr] //! author : Milan Janačković : https://github.com/milan-j +//! author : Stefan Crnjaković : https://github.com/crnjakovic ;(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' @@ -61,10 +62,10 @@ longDateFormat: { LT: 'H:mm', LTS: 'H:mm:ss', - L: 'DD.MM.YYYY', - LL: 'D. MMMM YYYY', - LLL: 'D. MMMM YYYY H:mm', - LLLL: 'dddd, D. MMMM YYYY H:mm', + L: 'D. M. YYYY.', + LL: 'D. MMMM YYYY.', + LLL: 'D. MMMM YYYY. H:mm', + LLLL: 'dddd, D. MMMM YYYY. H:mm', }, calendar: { sameDay: '[danas u] LT', diff --git a/locale/ta.js b/locale/ta.js index 139f1ecb0..beafdee29 100644 --- a/locale/ta.js +++ b/locale/ta.js @@ -12,16 +12,16 @@ //! moment.js locale configuration var symbolMap = { - '1': '௧', - '2': '௨', - '3': '௩', - '4': '௪', - '5': '௫', - '6': '௬', - '7': '௭', - '8': '௮', - '9': '௯', - '0': '௦', + 1: '௧', + 2: '௨', + 3: '௩', + 4: '௪', + 5: '௫', + 6: '௬', + 7: '௭', + 8: '௮', + 9: '௯', + 0: '௦', }, numberMap = { '௧': '1', diff --git a/locale/tg.js b/locale/tg.js index a8ae77756..b4c7bfc76 100644 --- a/locale/tg.js +++ b/locale/tg.js @@ -37,9 +37,14 @@ }; var tg = moment.defineLocale('tg', { - months: 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split( - '_' - ), + months: { + format: 'январи_феврали_марти_апрели_майи_июни_июли_августи_сентябри_октябри_ноябри_декабри'.split( + '_' + ), + standalone: 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split( + '_' + ), + }, monthsShort: 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'), weekdays: 'якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе'.split( '_' @@ -49,14 +54,14 @@ longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', - L: 'DD/MM/YYYY', + L: 'DD.MM.YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd, D MMMM YYYY HH:mm', }, calendar: { sameDay: '[Имрӯз соати] LT', - nextDay: '[Пагоҳ соати] LT', + nextDay: '[Фардо соати] LT', lastDay: '[Дирӯз соати] LT', nextWeek: 'dddd[и] [ҳафтаи оянда соати] LT', lastWeek: 'dddd[и] [ҳафтаи гузашта соати] LT', diff --git a/locale/th.js b/locale/th.js index 4e82f1b1d..2e69b7b6a 100644 --- a/locale/th.js +++ b/locale/th.js @@ -61,6 +61,8 @@ hh: '%d ชั่วโมง', d: '1 วัน', dd: '%d วัน', + w: '1 สัปดาห์', + ww: '%d สัปดาห์', M: '1 เดือน', MM: '%d เดือน', y: '1 ปี', diff --git a/locale/tr.js b/locale/tr.js index a0c5d4cfd..60bef61b6 100644 --- a/locale/tr.js +++ b/locale/tr.js @@ -81,6 +81,8 @@ hh: '%d saat', d: 'bir gün', dd: '%d gün', + w: 'bir hafta', + ww: '%d hafta', M: 'bir ay', MM: '%d ay', y: 'bir yıl', diff --git a/locale/vi.js b/locale/vi.js index 73cc083fc..ab8420a6d 100644 --- a/locale/vi.js +++ b/locale/vi.js @@ -68,6 +68,8 @@ hh: '%d giờ', d: 'một ngày', dd: '%d ngày', + w: 'một tuần', + ww: '%d tuần', M: 'một tháng', MM: '%d tháng', y: 'một năm', diff --git a/locale/zh-cn.js b/locale/zh-cn.js index ffbef76b7..c14ca47ca 100644 --- a/locale/zh-cn.js +++ b/locale/zh-cn.js @@ -112,6 +112,8 @@ hh: '%d 小时', d: '1 天', dd: '%d 天', + w: '1 周', + ww: '%d 周', M: '1 个月', MM: '%d 个月', y: '1 年', diff --git a/min/locales.js b/min/locales.js index caabe6a14..707c0e6dc 100644 --- a/min/locales.js +++ b/min/locales.js @@ -276,16 +276,16 @@ //! moment.js locale configuration var symbolMap = { - '1': '1', - '2': '2', - '3': '3', - '4': '4', - '5': '5', - '6': '6', - '7': '7', - '8': '8', - '9': '9', - '0': '0', + 1: '1', + 2: '2', + 3: '3', + 4: '4', + 5: '5', + 6: '6', + 7: '7', + 8: '8', + 9: '9', + 0: '0', }, pluralForm$1 = function (n) { return n === 0 @@ -487,24 +487,24 @@ yy: '%d سنوات', }, week: { - dow: 6, // Saturday is the first day of the week. - doy: 12, // The week that contains Jan 12th is the first week of the year. + dow: 1, // Monday is the first day of the week. + doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); //! moment.js locale configuration var symbolMap$1 = { - '1': '١', - '2': '٢', - '3': '٣', - '4': '٤', - '5': '٥', - '6': '٦', - '7': '٧', - '8': '٨', - '9': '٩', - '0': '٠', + 1: '١', + 2: '٢', + 3: '٣', + 4: '٤', + 5: '٥', + 6: '٦', + 7: '٧', + 8: '٨', + 9: '٩', + 0: '٠', }, numberMap = { '١': '1', @@ -647,16 +647,16 @@ //! moment.js locale configuration var symbolMap$2 = { - '1': '١', - '2': '٢', - '3': '٣', - '4': '٤', - '5': '٥', - '6': '٦', - '7': '٧', - '8': '٨', - '9': '٩', - '0': '٠', + 1: '١', + 2: '٢', + 3: '٣', + 4: '٤', + 5: '٥', + 6: '٦', + 7: '٧', + 8: '٨', + 9: '٩', + 0: '٠', }, numberMap$1 = { '١': '1', @@ -1113,6 +1113,8 @@ hh: '%d часа', d: 'ден', dd: '%d дена', + w: 'седмица', + ww: '%d седмици', M: 'месец', MM: '%d месеца', y: 'година', @@ -1195,16 +1197,16 @@ //! moment.js locale configuration var symbolMap$3 = { - '1': '১', - '2': '২', - '3': '৩', - '4': '৪', - '5': '৫', - '6': '৬', - '7': '৭', - '8': '৮', - '9': '৯', - '0': '০', + 1: '১', + 2: '২', + 3: '৩', + 4: '৪', + 5: '৫', + 6: '৬', + 7: '৭', + 8: '৮', + 9: '৯', + 0: '০', }, numberMap$2 = { '১': '1', @@ -1219,7 +1221,7 @@ '০': '0', }; - moment.defineLocale('bn', { + moment.defineLocale('bn-bd', { months: 'জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split( '_' ), @@ -1273,6 +1275,131 @@ return symbolMap$3[match]; }); }, + + meridiemParse: /রাত|ভোর|সকাল|দুপুর|বিকাল|সন্ধ্যা|রাত/, + meridiemHour: function (hour, meridiem) { + if (hour === 12) { + hour = 0; + } + if (meridiem === 'রাত') { + return hour < 4 ? hour : hour + 12; + } else if (meridiem === 'ভোর') { + return hour; + } else if (meridiem === 'সকাল') { + return hour; + } else if (meridiem === 'দুপুর') { + return hour >= 3 ? hour : hour + 12; + } else if (meridiem === 'বিকাল') { + return hour + 12; + } else if (meridiem === 'সন্ধ্যা') { + return hour + 12; + } + }, + + meridiem: function (hour, minute, isLower) { + if (hour < 4) { + return 'রাত'; + } else if (hour < 6) { + return 'ভোর'; + } else if (hour < 12) { + return 'সকাল'; + } else if (hour < 15) { + return 'দুপুর'; + } else if (hour < 18) { + return 'বিকাল'; + } else if (hour < 20) { + return 'সন্ধ্যা'; + } else { + return 'রাত'; + } + }, + week: { + dow: 0, // Sunday is the first day of the week. + doy: 6, // The week that contains Jan 6th is the first week of the year. + }, + }); + + //! moment.js locale configuration + + var symbolMap$4 = { + 1: '১', + 2: '২', + 3: '৩', + 4: '৪', + 5: '৫', + 6: '৬', + 7: '৭', + 8: '৮', + 9: '৯', + 0: '০', + }, + numberMap$3 = { + '১': '1', + '২': '2', + '৩': '3', + '৪': '4', + '৫': '5', + '৬': '6', + '৭': '7', + '৮': '8', + '৯': '9', + '০': '0', + }; + + moment.defineLocale('bn', { + months: 'জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split( + '_' + ), + monthsShort: 'জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে'.split( + '_' + ), + weekdays: 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার'.split( + '_' + ), + weekdaysShort: 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি'.split('_'), + weekdaysMin: 'রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি'.split('_'), + longDateFormat: { + LT: 'A h:mm সময়', + LTS: 'A h:mm:ss সময়', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY, A h:mm সময়', + LLLL: 'dddd, D MMMM YYYY, A h:mm সময়', + }, + calendar: { + sameDay: '[আজ] LT', + nextDay: '[আগামীকাল] LT', + nextWeek: 'dddd, LT', + lastDay: '[গতকাল] LT', + lastWeek: '[গত] dddd, LT', + sameElse: 'L', + }, + relativeTime: { + future: '%s পরে', + past: '%s আগে', + s: 'কয়েক সেকেন্ড', + ss: '%d সেকেন্ড', + m: 'এক মিনিট', + mm: '%d মিনিট', + h: 'এক ঘন্টা', + hh: '%d ঘন্টা', + d: 'এক দিন', + dd: '%d দিন', + M: 'এক মাস', + MM: '%d মাস', + y: 'এক বছর', + yy: '%d বছর', + }, + preparse: function (string) { + return string.replace(/[১২৩৪৫৬৭৮৯০]/g, function (match) { + return numberMap$3[match]; + }); + }, + postformat: function (string) { + return string.replace(/\d/g, function (match) { + return symbolMap$4[match]; + }); + }, meridiemParse: /রাত|সকাল|দুপুর|বিকাল|রাত/, meridiemHour: function (hour, meridiem) { if (hour === 12) { @@ -1309,19 +1436,19 @@ //! moment.js locale configuration - var symbolMap$4 = { - '1': '༡', - '2': '༢', - '3': '༣', - '4': '༤', - '5': '༥', - '6': '༦', - '7': '༧', - '8': '༨', - '9': '༩', - '0': '༠', + var symbolMap$5 = { + 1: '༡', + 2: '༢', + 3: '༣', + 4: '༤', + 5: '༥', + 6: '༦', + 7: '༧', + 8: '༨', + 9: '༩', + 0: '༠', }, - numberMap$3 = { + numberMap$4 = { '༡': '1', '༢': '2', '༣': '3', @@ -1384,12 +1511,12 @@ }, preparse: function (string) { return string.replace(/[༡༢༣༤༥༦༧༨༩༠]/g, function (match) { - return numberMap$3[match]; + return numberMap$4[match]; }); }, postformat: function (string) { return string.replace(/\d/g, function (match) { - return symbolMap$4[match]; + return symbolMap$5[match]; }); }, meridiemParse: /མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/, @@ -3265,6 +3392,8 @@ hh: '%d horas', d: 'un día', dd: '%d días', + w: 'una semana', + ww: '%d semanas', M: 'un mes', MM: '%d meses', y: 'un año', @@ -3300,7 +3429,7 @@ ], monthsRegex$3 = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i; - moment.defineLocale('es-us', { + moment.defineLocale('es-mx', { months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split( '_' ), @@ -3325,12 +3454,12 @@ weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'), weekdaysParseExact: true, longDateFormat: { - LT: 'h:mm A', - LTS: 'h:mm:ss A', - L: 'MM/DD/YYYY', + LT: 'H:mm', + LTS: 'H:mm:ss', + L: 'DD/MM/YYYY', LL: 'D [de] MMMM [de] YYYY', - LLL: 'D [de] MMMM [de] YYYY h:mm A', - LLLL: 'dddd, D [de] MMMM [de] YYYY h:mm A', + LLL: 'D [de] MMMM [de] YYYY H:mm', + LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm', }, calendar: { sameDay: function () { @@ -3365,6 +3494,8 @@ hh: '%d horas', d: 'un día', dd: '%d días', + w: 'una semana', + ww: '%d semanas', M: 'un mes', MM: '%d meses', y: 'un año', @@ -3374,8 +3505,9 @@ ordinal: '%dº', week: { dow: 0, // Sunday is the first day of the week. - doy: 6, // The week that contains Jan 6th is the first week of the year. + doy: 4, // The week that contains Jan 4th is the first week of the year. }, + invalidDate: 'Fecha inválida', }); //! moment.js locale configuration @@ -3400,7 +3532,7 @@ ], monthsRegex$4 = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i; - moment.defineLocale('es', { + moment.defineLocale('es-us', { months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split( '_' ), @@ -3424,6 +3556,108 @@ weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'), weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'), weekdaysParseExact: true, + longDateFormat: { + LT: 'h:mm A', + LTS: 'h:mm:ss A', + L: 'MM/DD/YYYY', + LL: 'D [de] MMMM [de] YYYY', + LLL: 'D [de] MMMM [de] YYYY h:mm A', + LLLL: 'dddd, D [de] MMMM [de] YYYY h:mm A', + }, + calendar: { + sameDay: function () { + return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; + }, + nextDay: function () { + return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; + }, + nextWeek: function () { + return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; + }, + lastDay: function () { + return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; + }, + lastWeek: function () { + return ( + '[el] dddd [pasado a la' + + (this.hours() !== 1 ? 's' : '') + + '] LT' + ); + }, + sameElse: 'L', + }, + relativeTime: { + future: 'en %s', + past: 'hace %s', + s: 'unos segundos', + ss: '%d segundos', + m: 'un minuto', + mm: '%d minutos', + h: 'una hora', + hh: '%d horas', + d: 'un día', + dd: '%d días', + w: 'una semana', + ww: '%d semanas', + M: 'un mes', + MM: '%d meses', + y: 'un año', + yy: '%d años', + }, + dayOfMonthOrdinalParse: /\d{1,2}º/, + ordinal: '%dº', + week: { + dow: 0, // Sunday is the first day of the week. + doy: 6, // The week that contains Jan 6th is the first week of the year. + }, + }); + + //! moment.js locale configuration + + var monthsShortDot$3 = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split( + '_' + ), + monthsShort$4 = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'), + monthsParse$5 = [ + /^ene/i, + /^feb/i, + /^mar/i, + /^abr/i, + /^may/i, + /^jun/i, + /^jul/i, + /^ago/i, + /^sep/i, + /^oct/i, + /^nov/i, + /^dic/i, + ], + monthsRegex$5 = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i; + + moment.defineLocale('es', { + months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split( + '_' + ), + monthsShort: function (m, format) { + if (!m) { + return monthsShortDot$3; + } else if (/-MMM-/.test(format)) { + return monthsShort$4[m.month()]; + } else { + return monthsShortDot$3[m.month()]; + } + }, + monthsRegex: monthsRegex$5, + monthsShortRegex: monthsRegex$5, + monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i, + monthsShortStrictRegex: /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i, + monthsParse: monthsParse$5, + longMonthsParse: monthsParse$5, + shortMonthsParse: monthsParse$5, + weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'), + weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'), + weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'), + weekdaysParseExact: true, longDateFormat: { LT: 'H:mm', LTS: 'H:mm:ss', @@ -3465,6 +3699,8 @@ hh: '%d horas', d: 'un día', dd: '%d días', + w: 'una semana', + ww: '%d semanas', M: 'un mes', MM: '%d meses', y: 'un año', @@ -3615,19 +3851,19 @@ //! moment.js locale configuration - var symbolMap$5 = { - '1': '۱', - '2': '۲', - '3': '۳', - '4': '۴', - '5': '۵', - '6': '۶', - '7': '۷', - '8': '۸', - '9': '۹', - '0': '۰', + var symbolMap$6 = { + 1: '۱', + 2: '۲', + 3: '۳', + 4: '۴', + 5: '۵', + 6: '۶', + 7: '۷', + 8: '۸', + 9: '۹', + 0: '۰', }, - numberMap$4 = { + numberMap$5 = { '۱': '1', '۲': '2', '۳': '3', @@ -3701,14 +3937,14 @@ preparse: function (string) { return string .replace(/[۰-۹]/g, function (match) { - return numberMap$4[match]; + return numberMap$5[match]; }) .replace(/،/g, ','); }, postformat: function (string) { return string .replace(/\d/g, function (match) { - return symbolMap$5[match]; + return symbolMap$6[match]; }) .replace(/,/g, '،'); }, @@ -4084,8 +4320,8 @@ var monthsStrictRegex$1 = /^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i, monthsShortStrictRegex$1 = /(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?)/i, - monthsRegex$5 = /(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?|janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i, - monthsParse$5 = [ + monthsRegex$6 = /(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?|janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i, + monthsParse$6 = [ /^janv/i, /^févr/i, /^mars/i, @@ -4107,13 +4343,13 @@ monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split( '_' ), - monthsRegex: monthsRegex$5, - monthsShortRegex: monthsRegex$5, + monthsRegex: monthsRegex$6, + monthsShortRegex: monthsRegex$6, monthsStrictRegex: monthsStrictRegex$1, monthsShortStrictRegex: monthsShortStrictRegex$1, - monthsParse: monthsParse$5, - longMonthsParse: monthsParse$5, - shortMonthsParse: monthsParse$5, + monthsParse: monthsParse$6, + longMonthsParse: monthsParse$6, + shortMonthsParse: monthsParse$6, weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'), weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'), weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'), @@ -4145,6 +4381,8 @@ hh: '%d heures', d: 'un jour', dd: '%d jours', + w: 'une semaine', + ww: '%d semaines', M: 'un mois', MM: '%d mois', y: 'un an', @@ -4269,7 +4507,7 @@ 'Samhain', 'Nollaig', ], - monthsShort$4 = [ + monthsShort$5 = [ 'Ean', 'Feabh', 'Márt', @@ -4297,7 +4535,7 @@ moment.defineLocale('ga', { months: months$5, - monthsShort: monthsShort$4, + monthsShort: monthsShort$5, monthsParseExact: true, weekdays: weekdays$1, weekdaysShort: weekdaysShort, @@ -4361,7 +4599,7 @@ 'An t-Samhain', 'An Dùbhlachd', ], - monthsShort$5 = [ + monthsShort$6 = [ 'Faoi', 'Gear', 'Màrt', @@ -4389,7 +4627,7 @@ moment.defineLocale('gd', { months: months$6, - monthsShort: monthsShort$5, + monthsShort: monthsShort$6, monthsParseExact: true, weekdays: weekdays$2, weekdaysShort: weekdaysShort$1, @@ -4752,19 +4990,19 @@ //! moment.js locale configuration - var symbolMap$6 = { - '1': '૧', - '2': '૨', - '3': '૩', - '4': '૪', - '5': '૫', - '6': '૬', - '7': '૭', - '8': '૮', - '9': '૯', - '0': '૦', + var symbolMap$7 = { + 1: '૧', + 2: '૨', + 3: '૩', + 4: '૪', + 5: '૫', + 6: '૬', + 7: '૭', + 8: '૮', + 9: '૯', + 0: '૦', }, - numberMap$5 = { + numberMap$6 = { '૧': '1', '૨': '2', '૩': '3', @@ -4824,12 +5062,12 @@ }, preparse: function (string) { return string.replace(/[૧૨૩૪૫૬૭૮૯૦]/g, function (match) { - return numberMap$5[match]; + return numberMap$6[match]; }); }, postformat: function (string) { return string.replace(/\d/g, function (match) { - return symbolMap$6[match]; + return symbolMap$7[match]; }); }, // Gujarati notation for meridiems are quite fuzzy in practice. While there exists @@ -4959,19 +5197,19 @@ //! moment.js locale configuration - var symbolMap$7 = { - '1': '१', - '2': '२', - '3': '३', - '4': '४', - '5': '५', - '6': '६', - '7': '७', - '8': '८', - '9': '९', - '0': '०', + var symbolMap$8 = { + 1: '१', + 2: '२', + 3: '३', + 4: '४', + 5: '५', + 6: '६', + 7: '७', + 8: '८', + 9: '९', + 0: '०', }, - numberMap$6 = { + numberMap$7 = { '१': '1', '२': '2', '३': '3', @@ -5029,12 +5267,12 @@ }, preparse: function (string) { return string.replace(/[१२३४५६७८९०]/g, function (match) { - return numberMap$6[match]; + return numberMap$7[match]; }); }, postformat: function (string) { return string.replace(/\d/g, function (match) { - return symbolMap$7[match]; + return symbolMap$8[match]; }); }, // Hindi notation for meridiems are quite fuzzy in practice. While there exists @@ -5276,9 +5514,10 @@ months: 'január_február_március_április_május_június_július_augusztus_szeptember_október_november_december'.split( '_' ), - monthsShort: 'jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec'.split( + monthsShort: 'jan._feb._márc._ápr._máj._jún._júl._aug._szept._okt._nov._dec.'.split( '_' ), + monthsParseExact: true, weekdays: 'vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat'.split('_'), weekdaysShort: 'vas_hét_kedd_sze_csüt_pén_szo'.split('_'), weekdaysMin: 'v_h_k_sze_cs_p_szo'.split('_'), @@ -5781,6 +6020,8 @@ hh: '%d ore', d: 'un giorno', dd: '%d giorni', + w: 'una settimana', + ww: '%d settimane', M: 'un mese', MM: '%d mesi', y: 'un anno', @@ -6181,19 +6422,19 @@ //! moment.js locale configuration - var symbolMap$8 = { - '1': '១', - '2': '២', - '3': '៣', - '4': '៤', - '5': '៥', - '6': '៦', - '7': '៧', - '8': '៨', - '9': '៩', - '0': '០', + var symbolMap$9 = { + 1: '១', + 2: '២', + 3: '៣', + 4: '៤', + 5: '៥', + 6: '៦', + 7: '៧', + 8: '៨', + 9: '៩', + 0: '០', }, - numberMap$7 = { + numberMap$8 = { '១': '1', '២': '2', '៣': '3', @@ -6264,12 +6505,12 @@ ordinal: 'ទី%d', preparse: function (string) { return string.replace(/[១២៣៤៥៦៧៨៩០]/g, function (match) { - return numberMap$7[match]; + return numberMap$8[match]; }); }, postformat: function (string) { return string.replace(/\d/g, function (match) { - return symbolMap$8[match]; + return symbolMap$9[match]; }); }, week: { @@ -6280,19 +6521,19 @@ //! moment.js locale configuration - var symbolMap$9 = { - '1': '೧', - '2': '೨', - '3': '೩', - '4': '೪', - '5': '೫', - '6': '೬', - '7': '೭', - '8': '೮', - '9': '೯', - '0': '೦', + var symbolMap$a = { + 1: '೧', + 2: '೨', + 3: '೩', + 4: '೪', + 5: '೫', + 6: '೬', + 7: '೭', + 8: '೮', + 9: '೯', + 0: '೦', }, - numberMap$8 = { + numberMap$9 = { '೧': '1', '೨': '2', '೩': '3', @@ -6352,12 +6593,12 @@ }, preparse: function (string) { return string.replace(/[೧೨೩೪೫೬೭೮೯೦]/g, function (match) { - return numberMap$8[match]; + return numberMap$9[match]; }); }, postformat: function (string) { return string.replace(/\d/g, function (match) { - return symbolMap$9[match]; + return symbolMap$a[match]; }); }, meridiemParse: /ರಾತ್ರಿ|ಬೆಳಿಗ್ಗೆ|ಮಧ್ಯಾಹ್ನ|ಸಂಜೆ/, @@ -6471,19 +6712,19 @@ //! moment.js locale configuration - var symbolMap$a = { - '1': '١', - '2': '٢', - '3': '٣', - '4': '٤', - '5': '٥', - '6': '٦', - '7': '٧', - '8': '٨', - '9': '٩', - '0': '٠', + var symbolMap$b = { + 1: '١', + 2: '٢', + 3: '٣', + 4: '٤', + 5: '٥', + 6: '٦', + 7: '٧', + 8: '٨', + 9: '٩', + 0: '٠', }, - numberMap$9 = { + numberMap$a = { '١': '1', '٢': '2', '٣': '3', @@ -6567,14 +6808,14 @@ preparse: function (string) { return string .replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) { - return numberMap$9[match]; + return numberMap$a[match]; }) .replace(/،/g, ','); }, postformat: function (string) { return string .replace(/\d/g, function (match) { - return symbolMap$a[match]; + return symbolMap$b[match]; }) .replace(/,/g, '،'); }, @@ -7495,19 +7736,19 @@ //! moment.js locale configuration - var symbolMap$b = { - '1': '१', - '2': '२', - '3': '३', - '4': '४', - '5': '५', - '6': '६', - '7': '७', - '8': '८', - '9': '९', - '0': '०', + var symbolMap$c = { + 1: '१', + 2: '२', + 3: '३', + 4: '४', + 5: '५', + 6: '६', + 7: '७', + 8: '८', + 9: '९', + 0: '०', }, - numberMap$a = { + numberMap$b = { '१': '1', '२': '2', '३': '3', @@ -7649,12 +7890,12 @@ }, preparse: function (string) { return string.replace(/[१२३४५६७८९०]/g, function (match) { - return numberMap$a[match]; + return numberMap$b[match]; }); }, postformat: function (string) { return string.replace(/\d/g, function (match) { - return symbolMap$b[match]; + return symbolMap$c[match]; }); }, meridiemParse: /पहाटे|सकाळी|दुपारी|सायंकाळी|रात्री/, @@ -7889,19 +8130,19 @@ //! moment.js locale configuration - var symbolMap$c = { - '1': '၁', - '2': '၂', - '3': '၃', - '4': '၄', - '5': '၅', - '6': '၆', - '7': '၇', - '8': '၈', - '9': '၉', - '0': '၀', + var symbolMap$d = { + 1: '၁', + 2: '၂', + 3: '၃', + 4: '၄', + 5: '၅', + 6: '၆', + 7: '၇', + 8: '၈', + 9: '၉', + 0: '၀', }, - numberMap$b = { + numberMap$c = { '၁': '1', '၂': '2', '၃': '3', @@ -7959,12 +8200,12 @@ }, preparse: function (string) { return string.replace(/[၁၂၃၄၅၆၇၈၉၀]/g, function (match) { - return numberMap$b[match]; + return numberMap$c[match]; }); }, postformat: function (string) { return string.replace(/\d/g, function (match) { - return symbolMap$c[match]; + return symbolMap$d[match]; }); }, week: { @@ -8014,6 +8255,8 @@ hh: '%d timer', d: 'en dag', dd: '%d dager', + w: 'en uke', + ww: '%d uker', M: 'en måned', MM: '%d måneder', y: 'ett år', @@ -8029,19 +8272,19 @@ //! moment.js locale configuration - var symbolMap$d = { - '1': '१', - '2': '२', - '3': '३', - '4': '४', - '5': '५', - '6': '६', - '7': '७', - '8': '८', - '9': '९', - '0': '०', + var symbolMap$e = { + 1: '१', + 2: '२', + 3: '३', + 4: '४', + 5: '५', + 6: '६', + 7: '७', + 8: '८', + 9: '९', + 0: '०', }, - numberMap$c = { + numberMap$d = { '१': '1', '२': '2', '३': '3', @@ -8078,12 +8321,12 @@ }, preparse: function (string) { return string.replace(/[१२३४५६७८९०]/g, function (match) { - return numberMap$c[match]; + return numberMap$d[match]; }); }, postformat: function (string) { return string.replace(/\d/g, function (match) { - return symbolMap$d[match]; + return symbolMap$e[match]; }); }, meridiemParse: /राति|बिहान|दिउँसो|साँझ/, @@ -8152,7 +8395,7 @@ monthsShortWithoutDots$1 = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split( '_' ), - monthsParse$6 = [ + monthsParse$7 = [ /^jan/i, /^feb/i, /^maart|mrt.?$/i, @@ -8166,7 +8409,7 @@ /^nov/i, /^dec/i, ], - monthsRegex$6 = /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i; + monthsRegex$7 = /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i; moment.defineLocale('nl-be', { months: 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split( @@ -8182,14 +8425,14 @@ } }, - monthsRegex: monthsRegex$6, - monthsShortRegex: monthsRegex$6, + monthsRegex: monthsRegex$7, + monthsShortRegex: monthsRegex$7, monthsStrictRegex: /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i, monthsShortStrictRegex: /^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i, - monthsParse: monthsParse$6, - longMonthsParse: monthsParse$6, - shortMonthsParse: monthsParse$6, + monthsParse: monthsParse$7, + longMonthsParse: monthsParse$7, + shortMonthsParse: monthsParse$7, weekdays: 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split( '_' @@ -8250,7 +8493,7 @@ monthsShortWithoutDots$2 = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split( '_' ), - monthsParse$7 = [ + monthsParse$8 = [ /^jan/i, /^feb/i, /^maart|mrt.?$/i, @@ -8264,7 +8507,7 @@ /^nov/i, /^dec/i, ], - monthsRegex$7 = /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i; + monthsRegex$8 = /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i; moment.defineLocale('nl', { months: 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split( @@ -8280,14 +8523,14 @@ } }, - monthsRegex: monthsRegex$7, - monthsShortRegex: monthsRegex$7, + monthsRegex: monthsRegex$8, + monthsShortRegex: monthsRegex$8, monthsStrictRegex: /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i, monthsShortStrictRegex: /^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i, - monthsParse: monthsParse$7, - longMonthsParse: monthsParse$7, - shortMonthsParse: monthsParse$7, + monthsParse: monthsParse$8, + longMonthsParse: monthsParse$8, + shortMonthsParse: monthsParse$8, weekdays: 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split( '_' @@ -8322,6 +8565,8 @@ hh: '%d uur', d: 'één dag', dd: '%d dagen', + w: 'één week', + ww: '%d weken', M: 'één maand', MM: '%d maanden', y: 'één jaar', @@ -8381,6 +8626,8 @@ hh: '%d timar', d: 'ein dag', dd: '%d dagar', + w: 'ei veke', + ww: '%d veker', M: 'ein månad', MM: '%d månader', y: 'eit år', @@ -8476,19 +8723,19 @@ //! moment.js locale configuration - var symbolMap$e = { - '1': '੧', - '2': '੨', - '3': '੩', - '4': '੪', - '5': '੫', - '6': '੬', - '7': '੭', - '8': '੮', - '9': '੯', - '0': '੦', + var symbolMap$f = { + 1: '੧', + 2: '੨', + 3: '੩', + 4: '੪', + 5: '੫', + 6: '੬', + 7: '੭', + 8: '੮', + 9: '੯', + 0: '੦', }, - numberMap$d = { + numberMap$e = { '੧': '1', '੨': '2', '੩': '3', @@ -8548,12 +8795,12 @@ }, preparse: function (string) { return string.replace(/[੧੨੩੪੫੬੭੮੯੦]/g, function (match) { - return numberMap$d[match]; + return numberMap$e[match]; }); }, postformat: function (string) { return string.replace(/\d/g, function (match) { - return symbolMap$e[match]; + return symbolMap$f[match]; }); }, // Punjabi notation for meridiems are quite fuzzy in practice. While there exists @@ -8599,7 +8846,21 @@ ), monthsSubjective = 'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia'.split( '_' - ); + ), + monthsParse$9 = [ + /^sty/i, + /^lut/i, + /^mar/i, + /^kwi/i, + /^maj/i, + /^cze/i, + /^lip/i, + /^sie/i, + /^wrz/i, + /^paź/i, + /^lis/i, + /^gru/i, + ]; function plural$3(n) { return n % 10 < 5 && n % 10 > 1 && ~~(n / 10) % 10 !== 1; } @@ -8616,6 +8877,8 @@ return withoutSuffix ? 'godzina' : 'godzinę'; case 'hh': return result + (plural$3(number) ? 'godziny' : 'godzin'); + case 'ww': + return result + (plural$3(number) ? 'tygodnie' : 'tygodni'); case 'MM': return result + (plural$3(number) ? 'miesiące' : 'miesięcy'); case 'yy': @@ -8627,17 +8890,6 @@ months: function (momentToFormat, format) { if (!momentToFormat) { return monthsNominative; - } else if (format === '') { - // Hack: if format empty we know this is used to generate - // RegExp by moment. Give then back both valid forms of months - // in RegExp ready format. - return ( - '(' + - monthsSubjective[momentToFormat.month()] + - '|' + - monthsNominative[momentToFormat.month()] + - ')' - ); } else if (/D MMMM/.test(format)) { return monthsSubjective[momentToFormat.month()]; } else { @@ -8645,6 +8897,9 @@ } }, monthsShort: 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'), + monthsParse: monthsParse$9, + longMonthsParse: monthsParse$9, + shortMonthsParse: monthsParse$9, weekdays: 'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split( '_' ), @@ -8705,6 +8960,8 @@ hh: translate$8, d: '1 dzień', dd: '%d dni', + w: 'tydzień', + ww: translate$8, M: 'miesiąc', MM: translate$8, y: 'rok', @@ -8769,6 +9026,7 @@ }, dayOfMonthOrdinalParse: /\d{1,2}º/, ordinal: '%dº', + invalidDate: 'Data inválida', }); //! moment.js locale configuration @@ -8815,6 +9073,8 @@ hh: '%d horas', d: 'um dia', dd: '%d dias', + w: 'uma semana', + ww: '%d semanas', M: 'um mês', MM: '%d meses', y: 'um ano', @@ -8836,6 +9096,7 @@ mm: 'minute', hh: 'ore', dd: 'zile', + ww: 'săptămâni', MM: 'luni', yy: 'ani', }, @@ -8884,6 +9145,8 @@ hh: relativeTimeWithPlural$2, d: 'o zi', dd: relativeTimeWithPlural$2, + w: 'o săptămână', + ww: relativeTimeWithPlural$2, M: 'o lună', MM: relativeTimeWithPlural$2, y: 'un an', @@ -8911,6 +9174,7 @@ mm: withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут', hh: 'час_часа_часов', dd: 'день_дня_дней', + ww: 'неделя_недели_недель', MM: 'месяц_месяца_месяцев', yy: 'год_года_лет', }; @@ -8920,7 +9184,7 @@ return number + ' ' + plural$4(format[key], +number); } } - var monthsParse$8 = [ + var monthsParse$a = [ /^янв/i, /^фев/i, /^мар/i, @@ -8967,9 +9231,9 @@ }, weekdaysShort: 'вс_пн_вт_ср_чт_пт_сб'.split('_'), weekdaysMin: 'вс_пн_вт_ср_чт_пт_сб'.split('_'), - monthsParse: monthsParse$8, - longMonthsParse: monthsParse$8, - shortMonthsParse: monthsParse$8, + monthsParse: monthsParse$a, + longMonthsParse: monthsParse$a, + shortMonthsParse: monthsParse$a, // полные названия с падежами, по три буквы, для некоторых, по 4 буквы, сокращения с точкой и без точки monthsRegex: /^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i, @@ -9051,6 +9315,8 @@ hh: relativeTimeWithPlural$3, d: 'день', dd: relativeTimeWithPlural$3, + w: 'неделя', + ww: relativeTimeWithPlural$3, M: 'месяц', MM: relativeTimeWithPlural$3, y: 'год', @@ -9295,7 +9561,7 @@ var months$9 = 'január_február_marec_apríl_máj_jún_júl_august_september_október_november_december'.split( '_' ), - monthsShort$6 = 'jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec'.split('_'); + monthsShort$7 = 'jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec'.split('_'); function plural$5(n) { return n > 1 && n < 5; } @@ -9355,7 +9621,7 @@ moment.defineLocale('sk', { months: months$9, - monthsShort: monthsShort$6, + monthsShort: monthsShort$7, weekdays: 'nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota'.split('_'), weekdaysShort: 'ne_po_ut_st_št_pi_so'.split('_'), weekdaysMin: 'ne_po_ut_st_št_pi_so'.split('_'), @@ -9707,10 +9973,10 @@ longDateFormat: { LT: 'H:mm', LTS: 'H:mm:ss', - L: 'DD.MM.YYYY', - LL: 'D. MMMM YYYY', - LLL: 'D. MMMM YYYY H:mm', - LLLL: 'dddd, D. MMMM YYYY H:mm', + L: 'D. M. YYYY.', + LL: 'D. MMMM YYYY.', + LLL: 'D. MMMM YYYY. H:mm', + LLLL: 'dddd, D. MMMM YYYY. H:mm', }, calendar: { sameDay: '[данас у] LT', @@ -9765,7 +10031,7 @@ ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. - doy: 7, // The week that contains Jan 7th is the first week of the year. + doy: 7, // The week that contains Jan 1st is the first week of the year. }, }); @@ -9821,10 +10087,10 @@ longDateFormat: { LT: 'H:mm', LTS: 'H:mm:ss', - L: 'DD.MM.YYYY', - LL: 'D. MMMM YYYY', - LLL: 'D. MMMM YYYY H:mm', - LLLL: 'dddd, D. MMMM YYYY H:mm', + L: 'D. M. YYYY.', + LL: 'D. MMMM YYYY.', + LLL: 'D. MMMM YYYY. H:mm', + LLLL: 'dddd, D. MMMM YYYY. H:mm', }, calendar: { sameDay: '[danas u] LT', @@ -10081,19 +10347,19 @@ //! moment.js locale configuration - var symbolMap$f = { - '1': '௧', - '2': '௨', - '3': '௩', - '4': '௪', - '5': '௫', - '6': '௬', - '7': '௭', - '8': '௮', - '9': '௯', - '0': '௦', + var symbolMap$g = { + 1: '௧', + 2: '௨', + 3: '௩', + 4: '௪', + 5: '௫', + 6: '௬', + 7: '௭', + 8: '௮', + 9: '௯', + 0: '௦', }, - numberMap$e = { + numberMap$f = { '௧': '1', '௨': '2', '௩': '3', @@ -10158,12 +10424,12 @@ }, preparse: function (string) { return string.replace(/[௧௨௩௪௫௬௭௮௯௦]/g, function (match) { - return numberMap$e[match]; + return numberMap$f[match]; }); }, postformat: function (string) { return string.replace(/\d/g, function (match) { - return symbolMap$f[match]; + return symbolMap$g[match]; }); }, // refer http://ta.wikipedia.org/s/1er1 @@ -10379,9 +10645,14 @@ }; moment.defineLocale('tg', { - months: 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split( - '_' - ), + months: { + format: 'январи_феврали_марти_апрели_майи_июни_июли_августи_сентябри_октябри_ноябри_декабри'.split( + '_' + ), + standalone: 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split( + '_' + ), + }, monthsShort: 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'), weekdays: 'якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе'.split( '_' @@ -10391,14 +10662,14 @@ longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', - L: 'DD/MM/YYYY', + L: 'DD.MM.YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd, D MMMM YYYY HH:mm', }, calendar: { sameDay: '[Имрӯз соати] LT', - nextDay: '[Пагоҳ соати] LT', + nextDay: '[Фардо соати] LT', lastDay: '[Дирӯз соати] LT', nextWeek: 'dddd[и] [ҳафтаи оянда соати] LT', lastWeek: 'dddd[и] [ҳафтаи гузашта соати] LT', @@ -10511,6 +10782,8 @@ hh: '%d ชั่วโมง', d: '1 วัน', dd: '%d วัน', + w: '1 สัปดาห์', + ww: '%d สัปดาห์', M: '1 เดือน', MM: '%d เดือน', y: '1 ปี', @@ -10853,6 +11126,8 @@ hh: '%d saat', d: 'bir gün', dd: '%d gün', + w: 'bir hafta', + ww: '%d hafta', M: 'bir ay', MM: '%d ay', y: 'bir yıl', @@ -11567,6 +11842,8 @@ hh: '%d giờ', d: 'một ngày', dd: '%d ngày', + w: 'một tuần', + ww: '%d tuần', M: 'một tháng', MM: '%d tháng', y: 'một năm', @@ -11801,6 +12078,8 @@ hh: '%d 小时', d: '1 天', dd: '%d 天', + w: '1 周', + ww: '%d 周', M: '1 个月', MM: '%d 个月', y: '1 年', diff --git a/min/locales.min.js b/min/locales.min.js index 56da071ae..9677b7fa2 100644 --- a/min/locales.min.js +++ b/min/locales.min.js @@ -1,2 +1,2 @@ -!function(e,a){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?a(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],a):a(e.moment)}(this,function(e){"use strict";e.defineLocale("af",{months:"Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des".split("_"),weekdays:"Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag".split("_"),weekdaysShort:"Son_Maa_Din_Woe_Don_Vry_Sat".split("_"),weekdaysMin:"So_Ma_Di_Wo_Do_Vr_Sa".split("_"),meridiemParse:/vm|nm/i,isPM:function(e){return/^nm$/i.test(e)},meridiem:function(e,a,_){return e<12?_?"vm":"VM":_?"nm":"NM"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Vandag om] LT",nextDay:"[M\xf4re om] LT",nextWeek:"dddd [om] LT",lastDay:"[Gister om] LT",lastWeek:"[Laas] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oor %s",past:"%s gelede",s:"'n paar sekondes",ss:"%d sekondes",m:"'n minuut",mm:"%d minute",h:"'n uur",hh:"%d ure",d:"'n dag",dd:"%d dae",M:"'n maand",MM:"%d maande",y:"'n jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||20<=e?"ste":"de")},week:{dow:1,doy:4}});function r(e){return 0===e?0:1===e?1:2===e?2:3<=e%100&&e%100<=10?3:11<=e%100?4:5}function a(n){return function(e,a,_,s){var d=r(e),t=i[n][r(e)];return 2===d&&(t=t[a?0:1]),t.replace(/%d/i,e)}}var i={s:["\u0623\u0642\u0644 \u0645\u0646 \u062b\u0627\u0646\u064a\u0629","\u062b\u0627\u0646\u064a\u0629 \u0648\u0627\u062d\u062f\u0629",["\u062b\u0627\u0646\u064a\u062a\u0627\u0646","\u062b\u0627\u0646\u064a\u062a\u064a\u0646"],"%d \u062b\u0648\u0627\u0646","%d \u062b\u0627\u0646\u064a\u0629","%d \u062b\u0627\u0646\u064a\u0629"],m:["\u0623\u0642\u0644 \u0645\u0646 \u062f\u0642\u064a\u0642\u0629","\u062f\u0642\u064a\u0642\u0629 \u0648\u0627\u062d\u062f\u0629",["\u062f\u0642\u064a\u0642\u062a\u0627\u0646","\u062f\u0642\u064a\u0642\u062a\u064a\u0646"],"%d \u062f\u0642\u0627\u0626\u0642","%d \u062f\u0642\u064a\u0642\u0629","%d \u062f\u0642\u064a\u0642\u0629"],h:["\u0623\u0642\u0644 \u0645\u0646 \u0633\u0627\u0639\u0629","\u0633\u0627\u0639\u0629 \u0648\u0627\u062d\u062f\u0629",["\u0633\u0627\u0639\u062a\u0627\u0646","\u0633\u0627\u0639\u062a\u064a\u0646"],"%d \u0633\u0627\u0639\u0627\u062a","%d \u0633\u0627\u0639\u0629","%d \u0633\u0627\u0639\u0629"],d:["\u0623\u0642\u0644 \u0645\u0646 \u064a\u0648\u0645","\u064a\u0648\u0645 \u0648\u0627\u062d\u062f",["\u064a\u0648\u0645\u0627\u0646","\u064a\u0648\u0645\u064a\u0646"],"%d \u0623\u064a\u0627\u0645","%d \u064a\u0648\u0645\u064b\u0627","%d \u064a\u0648\u0645"],M:["\u0623\u0642\u0644 \u0645\u0646 \u0634\u0647\u0631","\u0634\u0647\u0631 \u0648\u0627\u062d\u062f",["\u0634\u0647\u0631\u0627\u0646","\u0634\u0647\u0631\u064a\u0646"],"%d \u0623\u0634\u0647\u0631","%d \u0634\u0647\u0631\u0627","%d \u0634\u0647\u0631"],y:["\u0623\u0642\u0644 \u0645\u0646 \u0639\u0627\u0645","\u0639\u0627\u0645 \u0648\u0627\u062d\u062f",["\u0639\u0627\u0645\u0627\u0646","\u0639\u0627\u0645\u064a\u0646"],"%d \u0623\u0639\u0648\u0627\u0645","%d \u0639\u0627\u0645\u064b\u0627","%d \u0639\u0627\u0645"]},_=["\u062c\u0627\u0646\u0641\u064a","\u0641\u064a\u0641\u0631\u064a","\u0645\u0627\u0631\u0633","\u0623\u0641\u0631\u064a\u0644","\u0645\u0627\u064a","\u062c\u0648\u0627\u0646","\u062c\u0648\u064a\u0644\u064a\u0629","\u0623\u0648\u062a","\u0633\u0628\u062a\u0645\u0628\u0631","\u0623\u0643\u062a\u0648\u0628\u0631","\u0646\u0648\u0641\u0645\u0628\u0631","\u062f\u064a\u0633\u0645\u0628\u0631"];e.defineLocale("ar-dz",{months:_,monthsShort:_,weekdays:"\u0627\u0644\u0623\u062d\u062f_\u0627\u0644\u0625\u062b\u0646\u064a\u0646_\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621_\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621_\u0627\u0644\u062e\u0645\u064a\u0633_\u0627\u0644\u062c\u0645\u0639\u0629_\u0627\u0644\u0633\u0628\u062a".split("_"),weekdaysShort:"\u0623\u062d\u062f_\u0625\u062b\u0646\u064a\u0646_\u062b\u0644\u0627\u062b\u0627\u0621_\u0623\u0631\u0628\u0639\u0627\u0621_\u062e\u0645\u064a\u0633_\u062c\u0645\u0639\u0629_\u0633\u0628\u062a".split("_"),weekdaysMin:"\u062d_\u0646_\u062b_\u0631_\u062e_\u062c_\u0633".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/\u200fM/\u200fYYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/\u0635|\u0645/,isPM:function(e){return"\u0645"===e},meridiem:function(e,a,_){return e<12?"\u0635":"\u0645"},calendar:{sameDay:"[\u0627\u0644\u064a\u0648\u0645 \u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextDay:"[\u063a\u062f\u064b\u0627 \u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextWeek:"dddd [\u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastDay:"[\u0623\u0645\u0633 \u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastWeek:"dddd [\u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",sameElse:"L"},relativeTime:{future:"\u0628\u0639\u062f %s",past:"\u0645\u0646\u0630 %s",s:a("s"),ss:a("s"),m:a("m"),mm:a("m"),h:a("h"),hh:a("h"),d:a("d"),dd:a("d"),M:a("M"),MM:a("M"),y:a("y"),yy:a("y")},postformat:function(e){return e.replace(/,/g,"\u060c")},week:{dow:0,doy:4}}),e.defineLocale("ar-kw",{months:"\u064a\u0646\u0627\u064a\u0631_\u0641\u0628\u0631\u0627\u064a\u0631_\u0645\u0627\u0631\u0633_\u0623\u0628\u0631\u064a\u0644_\u0645\u0627\u064a_\u064a\u0648\u0646\u064a\u0648_\u064a\u0648\u0644\u064a\u0648\u0632_\u063a\u0634\u062a_\u0634\u062a\u0646\u0628\u0631_\u0623\u0643\u062a\u0648\u0628\u0631_\u0646\u0648\u0646\u0628\u0631_\u062f\u062c\u0646\u0628\u0631".split("_"),monthsShort:"\u064a\u0646\u0627\u064a\u0631_\u0641\u0628\u0631\u0627\u064a\u0631_\u0645\u0627\u0631\u0633_\u0623\u0628\u0631\u064a\u0644_\u0645\u0627\u064a_\u064a\u0648\u0646\u064a\u0648_\u064a\u0648\u0644\u064a\u0648\u0632_\u063a\u0634\u062a_\u0634\u062a\u0646\u0628\u0631_\u0623\u0643\u062a\u0648\u0628\u0631_\u0646\u0648\u0646\u0628\u0631_\u062f\u062c\u0646\u0628\u0631".split("_"),weekdays:"\u0627\u0644\u0623\u062d\u062f_\u0627\u0644\u0625\u062a\u0646\u064a\u0646_\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621_\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621_\u0627\u0644\u062e\u0645\u064a\u0633_\u0627\u0644\u062c\u0645\u0639\u0629_\u0627\u0644\u0633\u0628\u062a".split("_"),weekdaysShort:"\u0627\u062d\u062f_\u0627\u062a\u0646\u064a\u0646_\u062b\u0644\u0627\u062b\u0627\u0621_\u0627\u0631\u0628\u0639\u0627\u0621_\u062e\u0645\u064a\u0633_\u062c\u0645\u0639\u0629_\u0633\u0628\u062a".split("_"),weekdaysMin:"\u062d_\u0646_\u062b_\u0631_\u062e_\u062c_\u0633".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[\u0627\u0644\u064a\u0648\u0645 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextDay:"[\u063a\u062f\u0627 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextWeek:"dddd [\u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastDay:"[\u0623\u0645\u0633 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastWeek:"dddd [\u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",sameElse:"L"},relativeTime:{future:"\u0641\u064a %s",past:"\u0645\u0646\u0630 %s",s:"\u062b\u0648\u0627\u0646",ss:"%d \u062b\u0627\u0646\u064a\u0629",m:"\u062f\u0642\u064a\u0642\u0629",mm:"%d \u062f\u0642\u0627\u0626\u0642",h:"\u0633\u0627\u0639\u0629",hh:"%d \u0633\u0627\u0639\u0627\u062a",d:"\u064a\u0648\u0645",dd:"%d \u0623\u064a\u0627\u0645",M:"\u0634\u0647\u0631",MM:"%d \u0623\u0634\u0647\u0631",y:"\u0633\u0646\u0629",yy:"%d \u0633\u0646\u0648\u0627\u062a"},week:{dow:0,doy:12}});function m(e){return 0===e?0:1===e?1:2===e?2:3<=e%100&&e%100<=10?3:11<=e%100?4:5}function s(n){return function(e,a,_,s){var d=m(e),t=o[n][m(e)];return 2===d&&(t=t[a?0:1]),t.replace(/%d/i,e)}}var d={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",0:"0"},o={s:["\u0623\u0642\u0644 \u0645\u0646 \u062b\u0627\u0646\u064a\u0629","\u062b\u0627\u0646\u064a\u0629 \u0648\u0627\u062d\u062f\u0629",["\u062b\u0627\u0646\u064a\u062a\u0627\u0646","\u062b\u0627\u0646\u064a\u062a\u064a\u0646"],"%d \u062b\u0648\u0627\u0646","%d \u062b\u0627\u0646\u064a\u0629","%d \u062b\u0627\u0646\u064a\u0629"],m:["\u0623\u0642\u0644 \u0645\u0646 \u062f\u0642\u064a\u0642\u0629","\u062f\u0642\u064a\u0642\u0629 \u0648\u0627\u062d\u062f\u0629",["\u062f\u0642\u064a\u0642\u062a\u0627\u0646","\u062f\u0642\u064a\u0642\u062a\u064a\u0646"],"%d \u062f\u0642\u0627\u0626\u0642","%d \u062f\u0642\u064a\u0642\u0629","%d \u062f\u0642\u064a\u0642\u0629"],h:["\u0623\u0642\u0644 \u0645\u0646 \u0633\u0627\u0639\u0629","\u0633\u0627\u0639\u0629 \u0648\u0627\u062d\u062f\u0629",["\u0633\u0627\u0639\u062a\u0627\u0646","\u0633\u0627\u0639\u062a\u064a\u0646"],"%d \u0633\u0627\u0639\u0627\u062a","%d \u0633\u0627\u0639\u0629","%d \u0633\u0627\u0639\u0629"],d:["\u0623\u0642\u0644 \u0645\u0646 \u064a\u0648\u0645","\u064a\u0648\u0645 \u0648\u0627\u062d\u062f",["\u064a\u0648\u0645\u0627\u0646","\u064a\u0648\u0645\u064a\u0646"],"%d \u0623\u064a\u0627\u0645","%d \u064a\u0648\u0645\u064b\u0627","%d \u064a\u0648\u0645"],M:["\u0623\u0642\u0644 \u0645\u0646 \u0634\u0647\u0631","\u0634\u0647\u0631 \u0648\u0627\u062d\u062f",["\u0634\u0647\u0631\u0627\u0646","\u0634\u0647\u0631\u064a\u0646"],"%d \u0623\u0634\u0647\u0631","%d \u0634\u0647\u0631\u0627","%d \u0634\u0647\u0631"],y:["\u0623\u0642\u0644 \u0645\u0646 \u0639\u0627\u0645","\u0639\u0627\u0645 \u0648\u0627\u062d\u062f",["\u0639\u0627\u0645\u0627\u0646","\u0639\u0627\u0645\u064a\u0646"],"%d \u0623\u0639\u0648\u0627\u0645","%d \u0639\u0627\u0645\u064b\u0627","%d \u0639\u0627\u0645"]},t=["\u064a\u0646\u0627\u064a\u0631","\u0641\u0628\u0631\u0627\u064a\u0631","\u0645\u0627\u0631\u0633","\u0623\u0628\u0631\u064a\u0644","\u0645\u0627\u064a\u0648","\u064a\u0648\u0646\u064a\u0648","\u064a\u0648\u0644\u064a\u0648","\u0623\u063a\u0633\u0637\u0633","\u0633\u0628\u062a\u0645\u0628\u0631","\u0623\u0643\u062a\u0648\u0628\u0631","\u0646\u0648\u0641\u0645\u0628\u0631","\u062f\u064a\u0633\u0645\u0628\u0631"];e.defineLocale("ar-ly",{months:t,monthsShort:t,weekdays:"\u0627\u0644\u0623\u062d\u062f_\u0627\u0644\u0625\u062b\u0646\u064a\u0646_\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621_\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621_\u0627\u0644\u062e\u0645\u064a\u0633_\u0627\u0644\u062c\u0645\u0639\u0629_\u0627\u0644\u0633\u0628\u062a".split("_"),weekdaysShort:"\u0623\u062d\u062f_\u0625\u062b\u0646\u064a\u0646_\u062b\u0644\u0627\u062b\u0627\u0621_\u0623\u0631\u0628\u0639\u0627\u0621_\u062e\u0645\u064a\u0633_\u062c\u0645\u0639\u0629_\u0633\u0628\u062a".split("_"),weekdaysMin:"\u062d_\u0646_\u062b_\u0631_\u062e_\u062c_\u0633".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/\u200fM/\u200fYYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/\u0635|\u0645/,isPM:function(e){return"\u0645"===e},meridiem:function(e,a,_){return e<12?"\u0635":"\u0645"},calendar:{sameDay:"[\u0627\u0644\u064a\u0648\u0645 \u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextDay:"[\u063a\u062f\u064b\u0627 \u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextWeek:"dddd [\u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastDay:"[\u0623\u0645\u0633 \u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastWeek:"dddd [\u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",sameElse:"L"},relativeTime:{future:"\u0628\u0639\u062f %s",past:"\u0645\u0646\u0630 %s",s:s("s"),ss:s("s"),m:s("m"),mm:s("m"),h:s("h"),hh:s("h"),d:s("d"),dd:s("d"),M:s("M"),MM:s("M"),y:s("y"),yy:s("y")},preparse:function(e){return e.replace(/\u060c/g,",")},postformat:function(e){return e.replace(/\d/g,function(e){return d[e]}).replace(/,/g,"\u060c")},week:{dow:6,doy:12}}),e.defineLocale("ar-ma",{months:"\u064a\u0646\u0627\u064a\u0631_\u0641\u0628\u0631\u0627\u064a\u0631_\u0645\u0627\u0631\u0633_\u0623\u0628\u0631\u064a\u0644_\u0645\u0627\u064a_\u064a\u0648\u0646\u064a\u0648_\u064a\u0648\u0644\u064a\u0648\u0632_\u063a\u0634\u062a_\u0634\u062a\u0646\u0628\u0631_\u0623\u0643\u062a\u0648\u0628\u0631_\u0646\u0648\u0646\u0628\u0631_\u062f\u062c\u0646\u0628\u0631".split("_"),monthsShort:"\u064a\u0646\u0627\u064a\u0631_\u0641\u0628\u0631\u0627\u064a\u0631_\u0645\u0627\u0631\u0633_\u0623\u0628\u0631\u064a\u0644_\u0645\u0627\u064a_\u064a\u0648\u0646\u064a\u0648_\u064a\u0648\u0644\u064a\u0648\u0632_\u063a\u0634\u062a_\u0634\u062a\u0646\u0628\u0631_\u0623\u0643\u062a\u0648\u0628\u0631_\u0646\u0648\u0646\u0628\u0631_\u062f\u062c\u0646\u0628\u0631".split("_"),weekdays:"\u0627\u0644\u0623\u062d\u062f_\u0627\u0644\u0625\u062b\u0646\u064a\u0646_\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621_\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621_\u0627\u0644\u062e\u0645\u064a\u0633_\u0627\u0644\u062c\u0645\u0639\u0629_\u0627\u0644\u0633\u0628\u062a".split("_"),weekdaysShort:"\u0627\u062d\u062f_\u0627\u062b\u0646\u064a\u0646_\u062b\u0644\u0627\u062b\u0627\u0621_\u0627\u0631\u0628\u0639\u0627\u0621_\u062e\u0645\u064a\u0633_\u062c\u0645\u0639\u0629_\u0633\u0628\u062a".split("_"),weekdaysMin:"\u062d_\u0646_\u062b_\u0631_\u062e_\u062c_\u0633".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[\u0627\u0644\u064a\u0648\u0645 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextDay:"[\u063a\u062f\u0627 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextWeek:"dddd [\u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastDay:"[\u0623\u0645\u0633 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastWeek:"dddd [\u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",sameElse:"L"},relativeTime:{future:"\u0641\u064a %s",past:"\u0645\u0646\u0630 %s",s:"\u062b\u0648\u0627\u0646",ss:"%d \u062b\u0627\u0646\u064a\u0629",m:"\u062f\u0642\u064a\u0642\u0629",mm:"%d \u062f\u0642\u0627\u0626\u0642",h:"\u0633\u0627\u0639\u0629",hh:"%d \u0633\u0627\u0639\u0627\u062a",d:"\u064a\u0648\u0645",dd:"%d \u0623\u064a\u0627\u0645",M:"\u0634\u0647\u0631",MM:"%d \u0623\u0634\u0647\u0631",y:"\u0633\u0646\u0629",yy:"%d \u0633\u0646\u0648\u0627\u062a"},week:{dow:6,doy:12}});var n={1:"\u0661",2:"\u0662",3:"\u0663",4:"\u0664",5:"\u0665",6:"\u0666",7:"\u0667",8:"\u0668",9:"\u0669",0:"\u0660"},u={"\u0661":"1","\u0662":"2","\u0663":"3","\u0664":"4","\u0665":"5","\u0666":"6","\u0667":"7","\u0668":"8","\u0669":"9","\u0660":"0"};e.defineLocale("ar-sa",{months:"\u064a\u0646\u0627\u064a\u0631_\u0641\u0628\u0631\u0627\u064a\u0631_\u0645\u0627\u0631\u0633_\u0623\u0628\u0631\u064a\u0644_\u0645\u0627\u064a\u0648_\u064a\u0648\u0646\u064a\u0648_\u064a\u0648\u0644\u064a\u0648_\u0623\u063a\u0633\u0637\u0633_\u0633\u0628\u062a\u0645\u0628\u0631_\u0623\u0643\u062a\u0648\u0628\u0631_\u0646\u0648\u0641\u0645\u0628\u0631_\u062f\u064a\u0633\u0645\u0628\u0631".split("_"),monthsShort:"\u064a\u0646\u0627\u064a\u0631_\u0641\u0628\u0631\u0627\u064a\u0631_\u0645\u0627\u0631\u0633_\u0623\u0628\u0631\u064a\u0644_\u0645\u0627\u064a\u0648_\u064a\u0648\u0646\u064a\u0648_\u064a\u0648\u0644\u064a\u0648_\u0623\u063a\u0633\u0637\u0633_\u0633\u0628\u062a\u0645\u0628\u0631_\u0623\u0643\u062a\u0648\u0628\u0631_\u0646\u0648\u0641\u0645\u0628\u0631_\u062f\u064a\u0633\u0645\u0628\u0631".split("_"),weekdays:"\u0627\u0644\u0623\u062d\u062f_\u0627\u0644\u0625\u062b\u0646\u064a\u0646_\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621_\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621_\u0627\u0644\u062e\u0645\u064a\u0633_\u0627\u0644\u062c\u0645\u0639\u0629_\u0627\u0644\u0633\u0628\u062a".split("_"),weekdaysShort:"\u0623\u062d\u062f_\u0625\u062b\u0646\u064a\u0646_\u062b\u0644\u0627\u062b\u0627\u0621_\u0623\u0631\u0628\u0639\u0627\u0621_\u062e\u0645\u064a\u0633_\u062c\u0645\u0639\u0629_\u0633\u0628\u062a".split("_"),weekdaysMin:"\u062d_\u0646_\u062b_\u0631_\u062e_\u062c_\u0633".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/\u0635|\u0645/,isPM:function(e){return"\u0645"===e},meridiem:function(e,a,_){return e<12?"\u0635":"\u0645"},calendar:{sameDay:"[\u0627\u0644\u064a\u0648\u0645 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextDay:"[\u063a\u062f\u0627 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextWeek:"dddd [\u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastDay:"[\u0623\u0645\u0633 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastWeek:"dddd [\u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",sameElse:"L"},relativeTime:{future:"\u0641\u064a %s",past:"\u0645\u0646\u0630 %s",s:"\u062b\u0648\u0627\u0646",ss:"%d \u062b\u0627\u0646\u064a\u0629",m:"\u062f\u0642\u064a\u0642\u0629",mm:"%d \u062f\u0642\u0627\u0626\u0642",h:"\u0633\u0627\u0639\u0629",hh:"%d \u0633\u0627\u0639\u0627\u062a",d:"\u064a\u0648\u0645",dd:"%d \u0623\u064a\u0627\u0645",M:"\u0634\u0647\u0631",MM:"%d \u0623\u0634\u0647\u0631",y:"\u0633\u0646\u0629",yy:"%d \u0633\u0646\u0648\u0627\u062a"},preparse:function(e){return e.replace(/[\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\u0660]/g,function(e){return u[e]}).replace(/\u060c/g,",")},postformat:function(e){return e.replace(/\d/g,function(e){return n[e]}).replace(/,/g,"\u060c")},week:{dow:0,doy:6}}),e.defineLocale("ar-tn",{months:"\u062c\u0627\u0646\u0641\u064a_\u0641\u064a\u0641\u0631\u064a_\u0645\u0627\u0631\u0633_\u0623\u0641\u0631\u064a\u0644_\u0645\u0627\u064a_\u062c\u0648\u0627\u0646_\u062c\u0648\u064a\u0644\u064a\u0629_\u0623\u0648\u062a_\u0633\u0628\u062a\u0645\u0628\u0631_\u0623\u0643\u062a\u0648\u0628\u0631_\u0646\u0648\u0641\u0645\u0628\u0631_\u062f\u064a\u0633\u0645\u0628\u0631".split("_"),monthsShort:"\u062c\u0627\u0646\u0641\u064a_\u0641\u064a\u0641\u0631\u064a_\u0645\u0627\u0631\u0633_\u0623\u0641\u0631\u064a\u0644_\u0645\u0627\u064a_\u062c\u0648\u0627\u0646_\u062c\u0648\u064a\u0644\u064a\u0629_\u0623\u0648\u062a_\u0633\u0628\u062a\u0645\u0628\u0631_\u0623\u0643\u062a\u0648\u0628\u0631_\u0646\u0648\u0641\u0645\u0628\u0631_\u062f\u064a\u0633\u0645\u0628\u0631".split("_"),weekdays:"\u0627\u0644\u0623\u062d\u062f_\u0627\u0644\u0625\u062b\u0646\u064a\u0646_\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621_\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621_\u0627\u0644\u062e\u0645\u064a\u0633_\u0627\u0644\u062c\u0645\u0639\u0629_\u0627\u0644\u0633\u0628\u062a".split("_"),weekdaysShort:"\u0623\u062d\u062f_\u0625\u062b\u0646\u064a\u0646_\u062b\u0644\u0627\u062b\u0627\u0621_\u0623\u0631\u0628\u0639\u0627\u0621_\u062e\u0645\u064a\u0633_\u062c\u0645\u0639\u0629_\u0633\u0628\u062a".split("_"),weekdaysMin:"\u062d_\u0646_\u062b_\u0631_\u062e_\u062c_\u0633".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[\u0627\u0644\u064a\u0648\u0645 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextDay:"[\u063a\u062f\u0627 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextWeek:"dddd [\u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastDay:"[\u0623\u0645\u0633 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastWeek:"dddd [\u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",sameElse:"L"},relativeTime:{future:"\u0641\u064a %s",past:"\u0645\u0646\u0630 %s",s:"\u062b\u0648\u0627\u0646",ss:"%d \u062b\u0627\u0646\u064a\u0629",m:"\u062f\u0642\u064a\u0642\u0629",mm:"%d \u062f\u0642\u0627\u0626\u0642",h:"\u0633\u0627\u0639\u0629",hh:"%d \u0633\u0627\u0639\u0627\u062a",d:"\u064a\u0648\u0645",dd:"%d \u0623\u064a\u0627\u0645",M:"\u0634\u0647\u0631",MM:"%d \u0623\u0634\u0647\u0631",y:"\u0633\u0646\u0629",yy:"%d \u0633\u0646\u0648\u0627\u062a"},week:{dow:1,doy:4}});function l(e){return 0===e?0:1===e?1:2===e?2:3<=e%100&&e%100<=10?3:11<=e%100?4:5}function M(n){return function(e,a,_,s){var d=l(e),t=h[n][l(e)];return 2===d&&(t=t[a?0:1]),t.replace(/%d/i,e)}}var L={1:"\u0661",2:"\u0662",3:"\u0663",4:"\u0664",5:"\u0665",6:"\u0666",7:"\u0667",8:"\u0668",9:"\u0669",0:"\u0660"},Y={"\u0661":"1","\u0662":"2","\u0663":"3","\u0664":"4","\u0665":"5","\u0666":"6","\u0667":"7","\u0668":"8","\u0669":"9","\u0660":"0"},h={s:["\u0623\u0642\u0644 \u0645\u0646 \u062b\u0627\u0646\u064a\u0629","\u062b\u0627\u0646\u064a\u0629 \u0648\u0627\u062d\u062f\u0629",["\u062b\u0627\u0646\u064a\u062a\u0627\u0646","\u062b\u0627\u0646\u064a\u062a\u064a\u0646"],"%d \u062b\u0648\u0627\u0646","%d \u062b\u0627\u0646\u064a\u0629","%d \u062b\u0627\u0646\u064a\u0629"],m:["\u0623\u0642\u0644 \u0645\u0646 \u062f\u0642\u064a\u0642\u0629","\u062f\u0642\u064a\u0642\u0629 \u0648\u0627\u062d\u062f\u0629",["\u062f\u0642\u064a\u0642\u062a\u0627\u0646","\u062f\u0642\u064a\u0642\u062a\u064a\u0646"],"%d \u062f\u0642\u0627\u0626\u0642","%d \u062f\u0642\u064a\u0642\u0629","%d \u062f\u0642\u064a\u0642\u0629"],h:["\u0623\u0642\u0644 \u0645\u0646 \u0633\u0627\u0639\u0629","\u0633\u0627\u0639\u0629 \u0648\u0627\u062d\u062f\u0629",["\u0633\u0627\u0639\u062a\u0627\u0646","\u0633\u0627\u0639\u062a\u064a\u0646"],"%d \u0633\u0627\u0639\u0627\u062a","%d \u0633\u0627\u0639\u0629","%d \u0633\u0627\u0639\u0629"],d:["\u0623\u0642\u0644 \u0645\u0646 \u064a\u0648\u0645","\u064a\u0648\u0645 \u0648\u0627\u062d\u062f",["\u064a\u0648\u0645\u0627\u0646","\u064a\u0648\u0645\u064a\u0646"],"%d \u0623\u064a\u0627\u0645","%d \u064a\u0648\u0645\u064b\u0627","%d \u064a\u0648\u0645"],M:["\u0623\u0642\u0644 \u0645\u0646 \u0634\u0647\u0631","\u0634\u0647\u0631 \u0648\u0627\u062d\u062f",["\u0634\u0647\u0631\u0627\u0646","\u0634\u0647\u0631\u064a\u0646"],"%d \u0623\u0634\u0647\u0631","%d \u0634\u0647\u0631\u0627","%d \u0634\u0647\u0631"],y:["\u0623\u0642\u0644 \u0645\u0646 \u0639\u0627\u0645","\u0639\u0627\u0645 \u0648\u0627\u062d\u062f",["\u0639\u0627\u0645\u0627\u0646","\u0639\u0627\u0645\u064a\u0646"],"%d \u0623\u0639\u0648\u0627\u0645","%d \u0639\u0627\u0645\u064b\u0627","%d \u0639\u0627\u0645"]},y=["\u064a\u0646\u0627\u064a\u0631","\u0641\u0628\u0631\u0627\u064a\u0631","\u0645\u0627\u0631\u0633","\u0623\u0628\u0631\u064a\u0644","\u0645\u0627\u064a\u0648","\u064a\u0648\u0646\u064a\u0648","\u064a\u0648\u0644\u064a\u0648","\u0623\u063a\u0633\u0637\u0633","\u0633\u0628\u062a\u0645\u0628\u0631","\u0623\u0643\u062a\u0648\u0628\u0631","\u0646\u0648\u0641\u0645\u0628\u0631","\u062f\u064a\u0633\u0645\u0628\u0631"];e.defineLocale("ar",{months:y,monthsShort:y,weekdays:"\u0627\u0644\u0623\u062d\u062f_\u0627\u0644\u0625\u062b\u0646\u064a\u0646_\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621_\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621_\u0627\u0644\u062e\u0645\u064a\u0633_\u0627\u0644\u062c\u0645\u0639\u0629_\u0627\u0644\u0633\u0628\u062a".split("_"),weekdaysShort:"\u0623\u062d\u062f_\u0625\u062b\u0646\u064a\u0646_\u062b\u0644\u0627\u062b\u0627\u0621_\u0623\u0631\u0628\u0639\u0627\u0621_\u062e\u0645\u064a\u0633_\u062c\u0645\u0639\u0629_\u0633\u0628\u062a".split("_"),weekdaysMin:"\u062d_\u0646_\u062b_\u0631_\u062e_\u062c_\u0633".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/\u200fM/\u200fYYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/\u0635|\u0645/,isPM:function(e){return"\u0645"===e},meridiem:function(e,a,_){return e<12?"\u0635":"\u0645"},calendar:{sameDay:"[\u0627\u0644\u064a\u0648\u0645 \u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextDay:"[\u063a\u062f\u064b\u0627 \u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextWeek:"dddd [\u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastDay:"[\u0623\u0645\u0633 \u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastWeek:"dddd [\u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",sameElse:"L"},relativeTime:{future:"\u0628\u0639\u062f %s",past:"\u0645\u0646\u0630 %s",s:M("s"),ss:M("s"),m:M("m"),mm:M("m"),h:M("h"),hh:M("h"),d:M("d"),dd:M("d"),M:M("M"),MM:M("M"),y:M("y"),yy:M("y")},preparse:function(e){return e.replace(/[\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\u0660]/g,function(e){return Y[e]}).replace(/\u060c/g,",")},postformat:function(e){return e.replace(/\d/g,function(e){return L[e]}).replace(/,/g,"\u060c")},week:{dow:6,doy:12}});var c={1:"-inci",5:"-inci",8:"-inci",70:"-inci",80:"-inci",2:"-nci",7:"-nci",20:"-nci",50:"-nci",3:"-\xfcnc\xfc",4:"-\xfcnc\xfc",100:"-\xfcnc\xfc",6:"-nc\u0131",9:"-uncu",10:"-uncu",30:"-uncu",60:"-\u0131nc\u0131",90:"-\u0131nc\u0131"};function k(e,a,_){var s,d;return"m"===_?a?"\u0445\u0432\u0456\u043b\u0456\u043d\u0430":"\u0445\u0432\u0456\u043b\u0456\u043d\u0443":"h"===_?a?"\u0433\u0430\u0434\u0437\u0456\u043d\u0430":"\u0433\u0430\u0434\u0437\u0456\u043d\u0443":e+" "+(s=+e,d={ss:a?"\u0441\u0435\u043a\u0443\u043d\u0434\u0430_\u0441\u0435\u043a\u0443\u043d\u0434\u044b_\u0441\u0435\u043a\u0443\u043d\u0434":"\u0441\u0435\u043a\u0443\u043d\u0434\u0443_\u0441\u0435\u043a\u0443\u043d\u0434\u044b_\u0441\u0435\u043a\u0443\u043d\u0434",mm:a?"\u0445\u0432\u0456\u043b\u0456\u043d\u0430_\u0445\u0432\u0456\u043b\u0456\u043d\u044b_\u0445\u0432\u0456\u043b\u0456\u043d":"\u0445\u0432\u0456\u043b\u0456\u043d\u0443_\u0445\u0432\u0456\u043b\u0456\u043d\u044b_\u0445\u0432\u0456\u043b\u0456\u043d",hh:a?"\u0433\u0430\u0434\u0437\u0456\u043d\u0430_\u0433\u0430\u0434\u0437\u0456\u043d\u044b_\u0433\u0430\u0434\u0437\u0456\u043d":"\u0433\u0430\u0434\u0437\u0456\u043d\u0443_\u0433\u0430\u0434\u0437\u0456\u043d\u044b_\u0433\u0430\u0434\u0437\u0456\u043d",dd:"\u0434\u0437\u0435\u043d\u044c_\u0434\u043d\u0456_\u0434\u0437\u0451\u043d",MM:"\u043c\u0435\u0441\u044f\u0446_\u043c\u0435\u0441\u044f\u0446\u044b_\u043c\u0435\u0441\u044f\u0446\u0430\u045e",yy:"\u0433\u043e\u0434_\u0433\u0430\u0434\u044b_\u0433\u0430\u0434\u043e\u045e"}[_].split("_"),s%10==1&&s%100!=11?d[0]:2<=s%10&&s%10<=4&&(s%100<10||20<=s%100)?d[1]:d[2])}e.defineLocale("az",{months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekdays:"Bazar_Bazar ert\u0259si_\xc7\u0259r\u015f\u0259nb\u0259 ax\u015fam\u0131_\xc7\u0259r\u015f\u0259nb\u0259_C\xfcm\u0259 ax\u015fam\u0131_C\xfcm\u0259_\u015e\u0259nb\u0259".split("_"),weekdaysShort:"Baz_BzE_\xc7Ax_\xc7\u0259r_CAx_C\xfcm_\u015e\u0259n".split("_"),weekdaysMin:"Bz_BE_\xc7A_\xc7\u0259_CA_C\xfc_\u015e\u0259".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bug\xfcn saat] LT",nextDay:"[sabah saat] LT",nextWeek:"[g\u0259l\u0259n h\u0259ft\u0259] dddd [saat] LT",lastDay:"[d\xfcn\u0259n] LT",lastWeek:"[ke\xe7\u0259n h\u0259ft\u0259] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s \u0259vv\u0259l",s:"bir ne\xe7\u0259 saniy\u0259",ss:"%d saniy\u0259",m:"bir d\u0259qiq\u0259",mm:"%d d\u0259qiq\u0259",h:"bir saat",hh:"%d saat",d:"bir g\xfcn",dd:"%d g\xfcn",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},meridiemParse:/gec\u0259|s\u0259h\u0259r|g\xfcnd\xfcz|ax\u015fam/,isPM:function(e){return/^(g\xfcnd\xfcz|ax\u015fam)$/.test(e)},meridiem:function(e,a,_){return e<4?"gec\u0259":e<12?"s\u0259h\u0259r":e<17?"g\xfcnd\xfcz":"ax\u015fam"},dayOfMonthOrdinalParse:/\d{1,2}-(\u0131nc\u0131|inci|nci|\xfcnc\xfc|nc\u0131|uncu)/,ordinal:function(e){if(0===e)return e+"-\u0131nc\u0131";var a=e%10;return e+(c[a]||c[e%100-a]||c[100<=e?100:null])},week:{dow:1,doy:7}}),e.defineLocale("be",{months:{format:"\u0441\u0442\u0443\u0434\u0437\u0435\u043d\u044f_\u043b\u044e\u0442\u0430\u0433\u0430_\u0441\u0430\u043a\u0430\u0432\u0456\u043a\u0430_\u043a\u0440\u0430\u0441\u0430\u0432\u0456\u043a\u0430_\u0442\u0440\u0430\u045e\u043d\u044f_\u0447\u044d\u0440\u0432\u0435\u043d\u044f_\u043b\u0456\u043f\u0435\u043d\u044f_\u0436\u043d\u0456\u045e\u043d\u044f_\u0432\u0435\u0440\u0430\u0441\u043d\u044f_\u043a\u0430\u0441\u0442\u0440\u044b\u0447\u043d\u0456\u043a\u0430_\u043b\u0456\u0441\u0442\u0430\u043f\u0430\u0434\u0430_\u0441\u043d\u0435\u0436\u043d\u044f".split("_"),standalone:"\u0441\u0442\u0443\u0434\u0437\u0435\u043d\u044c_\u043b\u044e\u0442\u044b_\u0441\u0430\u043a\u0430\u0432\u0456\u043a_\u043a\u0440\u0430\u0441\u0430\u0432\u0456\u043a_\u0442\u0440\u0430\u0432\u0435\u043d\u044c_\u0447\u044d\u0440\u0432\u0435\u043d\u044c_\u043b\u0456\u043f\u0435\u043d\u044c_\u0436\u043d\u0456\u0432\u0435\u043d\u044c_\u0432\u0435\u0440\u0430\u0441\u0435\u043d\u044c_\u043a\u0430\u0441\u0442\u0440\u044b\u0447\u043d\u0456\u043a_\u043b\u0456\u0441\u0442\u0430\u043f\u0430\u0434_\u0441\u043d\u0435\u0436\u0430\u043d\u044c".split("_")},monthsShort:"\u0441\u0442\u0443\u0434_\u043b\u044e\u0442_\u0441\u0430\u043a_\u043a\u0440\u0430\u0441_\u0442\u0440\u0430\u0432_\u0447\u044d\u0440\u0432_\u043b\u0456\u043f_\u0436\u043d\u0456\u0432_\u0432\u0435\u0440_\u043a\u0430\u0441\u0442_\u043b\u0456\u0441\u0442_\u0441\u043d\u0435\u0436".split("_"),weekdays:{format:"\u043d\u044f\u0434\u0437\u0435\u043b\u044e_\u043f\u0430\u043d\u044f\u0434\u0437\u0435\u043b\u0430\u043a_\u0430\u045e\u0442\u043e\u0440\u0430\u043a_\u0441\u0435\u0440\u0430\u0434\u0443_\u0447\u0430\u0446\u0432\u0435\u0440_\u043f\u044f\u0442\u043d\u0456\u0446\u0443_\u0441\u0443\u0431\u043e\u0442\u0443".split("_"),standalone:"\u043d\u044f\u0434\u0437\u0435\u043b\u044f_\u043f\u0430\u043d\u044f\u0434\u0437\u0435\u043b\u0430\u043a_\u0430\u045e\u0442\u043e\u0440\u0430\u043a_\u0441\u0435\u0440\u0430\u0434\u0430_\u0447\u0430\u0446\u0432\u0435\u0440_\u043f\u044f\u0442\u043d\u0456\u0446\u0430_\u0441\u0443\u0431\u043e\u0442\u0430".split("_"),isFormat:/\[ ?[\u0423\u0443\u045e] ?(?:\u043c\u0456\u043d\u0443\u043b\u0443\u044e|\u043d\u0430\u0441\u0442\u0443\u043f\u043d\u0443\u044e)? ?\] ?dddd/},weekdaysShort:"\u043d\u0434_\u043f\u043d_\u0430\u0442_\u0441\u0440_\u0447\u0446_\u043f\u0442_\u0441\u0431".split("_"),weekdaysMin:"\u043d\u0434_\u043f\u043d_\u0430\u0442_\u0441\u0440_\u0447\u0446_\u043f\u0442_\u0441\u0431".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY \u0433.",LLL:"D MMMM YYYY \u0433., HH:mm",LLLL:"dddd, D MMMM YYYY \u0433., HH:mm"},calendar:{sameDay:"[\u0421\u0451\u043d\u043d\u044f \u045e] LT",nextDay:"[\u0417\u0430\u045e\u0442\u0440\u0430 \u045e] LT",lastDay:"[\u0423\u0447\u043e\u0440\u0430 \u045e] LT",nextWeek:function(){return"[\u0423] dddd [\u045e] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[\u0423 \u043c\u0456\u043d\u0443\u043b\u0443\u044e] dddd [\u045e] LT";case 1:case 2:case 4:return"[\u0423 \u043c\u0456\u043d\u0443\u043b\u044b] dddd [\u045e] LT"}},sameElse:"L"},relativeTime:{future:"\u043f\u0440\u0430\u0437 %s",past:"%s \u0442\u0430\u043c\u0443",s:"\u043d\u0435\u043a\u0430\u043b\u044c\u043a\u0456 \u0441\u0435\u043a\u0443\u043d\u0434",m:k,mm:k,h:k,hh:k,d:"\u0434\u0437\u0435\u043d\u044c",dd:k,M:"\u043c\u0435\u0441\u044f\u0446",MM:k,y:"\u0433\u043e\u0434",yy:k},meridiemParse:/\u043d\u043e\u0447\u044b|\u0440\u0430\u043d\u0456\u0446\u044b|\u0434\u043d\u044f|\u0432\u0435\u0447\u0430\u0440\u0430/,isPM:function(e){return/^(\u0434\u043d\u044f|\u0432\u0435\u0447\u0430\u0440\u0430)$/.test(e)},meridiem:function(e,a,_){return e<4?"\u043d\u043e\u0447\u044b":e<12?"\u0440\u0430\u043d\u0456\u0446\u044b":e<17?"\u0434\u043d\u044f":"\u0432\u0435\u0447\u0430\u0440\u0430"},dayOfMonthOrdinalParse:/\d{1,2}-(\u0456|\u044b|\u0433\u0430)/,ordinal:function(e,a){switch(a){case"M":case"d":case"DDD":case"w":case"W":return e%10!=2&&e%10!=3||e%100==12||e%100==13?e+"-\u044b":e+"-\u0456";case"D":return e+"-\u0433\u0430";default:return e}},week:{dow:1,doy:7}}),e.defineLocale("bg",{months:"\u044f\u043d\u0443\u0430\u0440\u0438_\u0444\u0435\u0432\u0440\u0443\u0430\u0440\u0438_\u043c\u0430\u0440\u0442_\u0430\u043f\u0440\u0438\u043b_\u043c\u0430\u0439_\u044e\u043d\u0438_\u044e\u043b\u0438_\u0430\u0432\u0433\u0443\u0441\u0442_\u0441\u0435\u043f\u0442\u0435\u043c\u0432\u0440\u0438_\u043e\u043a\u0442\u043e\u043c\u0432\u0440\u0438_\u043d\u043e\u0435\u043c\u0432\u0440\u0438_\u0434\u0435\u043a\u0435\u043c\u0432\u0440\u0438".split("_"),monthsShort:"\u044f\u043d\u0443_\u0444\u0435\u0432_\u043c\u0430\u0440_\u0430\u043f\u0440_\u043c\u0430\u0439_\u044e\u043d\u0438_\u044e\u043b\u0438_\u0430\u0432\u0433_\u0441\u0435\u043f_\u043e\u043a\u0442_\u043d\u043e\u0435_\u0434\u0435\u043a".split("_"),weekdays:"\u043d\u0435\u0434\u0435\u043b\u044f_\u043f\u043e\u043d\u0435\u0434\u0435\u043b\u043d\u0438\u043a_\u0432\u0442\u043e\u0440\u043d\u0438\u043a_\u0441\u0440\u044f\u0434\u0430_\u0447\u0435\u0442\u0432\u044a\u0440\u0442\u044a\u043a_\u043f\u0435\u0442\u044a\u043a_\u0441\u044a\u0431\u043e\u0442\u0430".split("_"),weekdaysShort:"\u043d\u0435\u0434_\u043f\u043e\u043d_\u0432\u0442\u043e_\u0441\u0440\u044f_\u0447\u0435\u0442_\u043f\u0435\u0442_\u0441\u044a\u0431".split("_"),weekdaysMin:"\u043d\u0434_\u043f\u043d_\u0432\u0442_\u0441\u0440_\u0447\u0442_\u043f\u0442_\u0441\u0431".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[\u0414\u043d\u0435\u0441 \u0432] LT",nextDay:"[\u0423\u0442\u0440\u0435 \u0432] LT",nextWeek:"dddd [\u0432] LT",lastDay:"[\u0412\u0447\u0435\u0440\u0430 \u0432] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[\u041c\u0438\u043d\u0430\u043b\u0430\u0442\u0430] dddd [\u0432] LT";case 1:case 2:case 4:case 5:return"[\u041c\u0438\u043d\u0430\u043b\u0438\u044f] dddd [\u0432] LT"}},sameElse:"L"},relativeTime:{future:"\u0441\u043b\u0435\u0434 %s",past:"\u043f\u0440\u0435\u0434\u0438 %s",s:"\u043d\u044f\u043a\u043e\u043b\u043a\u043e \u0441\u0435\u043a\u0443\u043d\u0434\u0438",ss:"%d \u0441\u0435\u043a\u0443\u043d\u0434\u0438",m:"\u043c\u0438\u043d\u0443\u0442\u0430",mm:"%d \u043c\u0438\u043d\u0443\u0442\u0438",h:"\u0447\u0430\u0441",hh:"%d \u0447\u0430\u0441\u0430",d:"\u0434\u0435\u043d",dd:"%d \u0434\u0435\u043d\u0430",M:"\u043c\u0435\u0441\u0435\u0446",MM:"%d \u043c\u0435\u0441\u0435\u0446\u0430",y:"\u0433\u043e\u0434\u0438\u043d\u0430",yy:"%d \u0433\u043e\u0434\u0438\u043d\u0438"},dayOfMonthOrdinalParse:/\d{1,2}-(\u0435\u0432|\u0435\u043d|\u0442\u0438|\u0432\u0438|\u0440\u0438|\u043c\u0438)/,ordinal:function(e){var a=e%10,_=e%100;return 0===e?e+"-\u0435\u0432":0==_?e+"-\u0435\u043d":10<_&&_<20?e+"-\u0442\u0438":1==a?e+"-\u0432\u0438":2==a?e+"-\u0440\u0438":7==a||8==a?e+"-\u043c\u0438":e+"-\u0442\u0438"},week:{dow:1,doy:7}}),e.defineLocale("bm",{months:"Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_M\u025bkalo_Zuw\u025bnkalo_Zuluyekalo_Utikalo_S\u025btanburukalo_\u0254kut\u0254burukalo_Nowanburukalo_Desanburukalo".split("_"),monthsShort:"Zan_Few_Mar_Awi_M\u025b_Zuw_Zul_Uti_S\u025bt_\u0254ku_Now_Des".split("_"),weekdays:"Kari_Nt\u025bn\u025bn_Tarata_Araba_Alamisa_Juma_Sibiri".split("_"),weekdaysShort:"Kar_Nt\u025b_Tar_Ara_Ala_Jum_Sib".split("_"),weekdaysMin:"Ka_Nt_Ta_Ar_Al_Ju_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"MMMM [tile] D [san] YYYY",LLL:"MMMM [tile] D [san] YYYY [l\u025br\u025b] HH:mm",LLLL:"dddd MMMM [tile] D [san] YYYY [l\u025br\u025b] HH:mm"},calendar:{sameDay:"[Bi l\u025br\u025b] LT",nextDay:"[Sini l\u025br\u025b] LT",nextWeek:"dddd [don l\u025br\u025b] LT",lastDay:"[Kunu l\u025br\u025b] LT",lastWeek:"dddd [t\u025bm\u025bnen l\u025br\u025b] LT",sameElse:"L"},relativeTime:{future:"%s k\u0254n\u0254",past:"a b\u025b %s b\u0254",s:"sanga dama dama",ss:"sekondi %d",m:"miniti kelen",mm:"miniti %d",h:"l\u025br\u025b kelen",hh:"l\u025br\u025b %d",d:"tile kelen",dd:"tile %d",M:"kalo kelen",MM:"kalo %d",y:"san kelen",yy:"san %d"},week:{dow:1,doy:4}});var D={1:"\u09e7",2:"\u09e8",3:"\u09e9",4:"\u09ea",5:"\u09eb",6:"\u09ec",7:"\u09ed",8:"\u09ee",9:"\u09ef",0:"\u09e6"},p={"\u09e7":"1","\u09e8":"2","\u09e9":"3","\u09ea":"4","\u09eb":"5","\u09ec":"6","\u09ed":"7","\u09ee":"8","\u09ef":"9","\u09e6":"0"};e.defineLocale("bn",{months:"\u099c\u09be\u09a8\u09c1\u09df\u09be\u09b0\u09bf_\u09ab\u09c7\u09ac\u09cd\u09b0\u09c1\u09df\u09be\u09b0\u09bf_\u09ae\u09be\u09b0\u09cd\u099a_\u098f\u09aa\u09cd\u09b0\u09bf\u09b2_\u09ae\u09c7_\u099c\u09c1\u09a8_\u099c\u09c1\u09b2\u09be\u0987_\u0986\u0997\u09b8\u09cd\u099f_\u09b8\u09c7\u09aa\u09cd\u099f\u09c7\u09ae\u09cd\u09ac\u09b0_\u0985\u0995\u09cd\u099f\u09cb\u09ac\u09b0_\u09a8\u09ad\u09c7\u09ae\u09cd\u09ac\u09b0_\u09a1\u09bf\u09b8\u09c7\u09ae\u09cd\u09ac\u09b0".split("_"),monthsShort:"\u099c\u09be\u09a8\u09c1_\u09ab\u09c7\u09ac\u09cd\u09b0\u09c1_\u09ae\u09be\u09b0\u09cd\u099a_\u098f\u09aa\u09cd\u09b0\u09bf\u09b2_\u09ae\u09c7_\u099c\u09c1\u09a8_\u099c\u09c1\u09b2\u09be\u0987_\u0986\u0997\u09b8\u09cd\u099f_\u09b8\u09c7\u09aa\u09cd\u099f_\u0985\u0995\u09cd\u099f\u09cb_\u09a8\u09ad\u09c7_\u09a1\u09bf\u09b8\u09c7".split("_"),weekdays:"\u09b0\u09ac\u09bf\u09ac\u09be\u09b0_\u09b8\u09cb\u09ae\u09ac\u09be\u09b0_\u09ae\u0999\u09cd\u0997\u09b2\u09ac\u09be\u09b0_\u09ac\u09c1\u09a7\u09ac\u09be\u09b0_\u09ac\u09c3\u09b9\u09b8\u09cd\u09aa\u09a4\u09bf\u09ac\u09be\u09b0_\u09b6\u09c1\u0995\u09cd\u09b0\u09ac\u09be\u09b0_\u09b6\u09a8\u09bf\u09ac\u09be\u09b0".split("_"),weekdaysShort:"\u09b0\u09ac\u09bf_\u09b8\u09cb\u09ae_\u09ae\u0999\u09cd\u0997\u09b2_\u09ac\u09c1\u09a7_\u09ac\u09c3\u09b9\u09b8\u09cd\u09aa\u09a4\u09bf_\u09b6\u09c1\u0995\u09cd\u09b0_\u09b6\u09a8\u09bf".split("_"),weekdaysMin:"\u09b0\u09ac\u09bf_\u09b8\u09cb\u09ae_\u09ae\u0999\u09cd\u0997\u09b2_\u09ac\u09c1\u09a7_\u09ac\u09c3\u09b9_\u09b6\u09c1\u0995\u09cd\u09b0_\u09b6\u09a8\u09bf".split("_"),longDateFormat:{LT:"A h:mm \u09b8\u09ae\u09df",LTS:"A h:mm:ss \u09b8\u09ae\u09df",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm \u09b8\u09ae\u09df",LLLL:"dddd, D MMMM YYYY, A h:mm \u09b8\u09ae\u09df"},calendar:{sameDay:"[\u0986\u099c] LT",nextDay:"[\u0986\u0997\u09be\u09ae\u09c0\u0995\u09be\u09b2] LT",nextWeek:"dddd, LT",lastDay:"[\u0997\u09a4\u0995\u09be\u09b2] LT",lastWeek:"[\u0997\u09a4] dddd, LT",sameElse:"L"},relativeTime:{future:"%s \u09aa\u09b0\u09c7",past:"%s \u0986\u0997\u09c7",s:"\u0995\u09df\u09c7\u0995 \u09b8\u09c7\u0995\u09c7\u09a8\u09cd\u09a1",ss:"%d \u09b8\u09c7\u0995\u09c7\u09a8\u09cd\u09a1",m:"\u098f\u0995 \u09ae\u09bf\u09a8\u09bf\u099f",mm:"%d \u09ae\u09bf\u09a8\u09bf\u099f",h:"\u098f\u0995 \u0998\u09a8\u09cd\u099f\u09be",hh:"%d \u0998\u09a8\u09cd\u099f\u09be",d:"\u098f\u0995 \u09a6\u09bf\u09a8",dd:"%d \u09a6\u09bf\u09a8",M:"\u098f\u0995 \u09ae\u09be\u09b8",MM:"%d \u09ae\u09be\u09b8",y:"\u098f\u0995 \u09ac\u099b\u09b0",yy:"%d \u09ac\u099b\u09b0"},preparse:function(e){return e.replace(/[\u09e7\u09e8\u09e9\u09ea\u09eb\u09ec\u09ed\u09ee\u09ef\u09e6]/g,function(e){return p[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return D[e]})},meridiemParse:/\u09b0\u09be\u09a4|\u09b8\u0995\u09be\u09b2|\u09a6\u09c1\u09aa\u09c1\u09b0|\u09ac\u09bf\u0995\u09be\u09b2|\u09b0\u09be\u09a4/,meridiemHour:function(e,a){return 12===e&&(e=0),"\u09b0\u09be\u09a4"===a&&4<=e||"\u09a6\u09c1\u09aa\u09c1\u09b0"===a&&e<5||"\u09ac\u09bf\u0995\u09be\u09b2"===a?e+12:e},meridiem:function(e,a,_){return e<4?"\u09b0\u09be\u09a4":e<10?"\u09b8\u0995\u09be\u09b2":e<17?"\u09a6\u09c1\u09aa\u09c1\u09b0":e<20?"\u09ac\u09bf\u0995\u09be\u09b2":"\u09b0\u09be\u09a4"},week:{dow:0,doy:6}});var T={1:"\u0f21",2:"\u0f22",3:"\u0f23",4:"\u0f24",5:"\u0f25",6:"\u0f26",7:"\u0f27",8:"\u0f28",9:"\u0f29",0:"\u0f20"},f={"\u0f21":"1","\u0f22":"2","\u0f23":"3","\u0f24":"4","\u0f25":"5","\u0f26":"6","\u0f27":"7","\u0f28":"8","\u0f29":"9","\u0f20":"0"};function g(e,a,_){var s;return e+" "+(s={mm:"munutenn",MM:"miz",dd:"devezh"}[_],2!==e?s:function(e){var a={m:"v",b:"v",d:"z"};return void 0!==a[e.charAt(0)]?a[e.charAt(0)]+e.substring(1):e}(s))}e.defineLocale("bo",{months:"\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f51\u0f44\u0f0b\u0f54\u0f7c_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f42\u0f49\u0f72\u0f66\u0f0b\u0f54_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f42\u0f66\u0f74\u0f58\u0f0b\u0f54_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f56\u0f5e\u0f72\u0f0b\u0f54_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f63\u0f94\u0f0b\u0f54_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f51\u0fb2\u0f74\u0f42\u0f0b\u0f54_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f56\u0f51\u0f74\u0f53\u0f0b\u0f54_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f56\u0f62\u0f92\u0fb1\u0f51\u0f0b\u0f54_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f51\u0f42\u0f74\u0f0b\u0f54_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f56\u0f45\u0f74\u0f0b\u0f54_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f56\u0f45\u0f74\u0f0b\u0f42\u0f45\u0f72\u0f42\u0f0b\u0f54_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f56\u0f45\u0f74\u0f0b\u0f42\u0f49\u0f72\u0f66\u0f0b\u0f54".split("_"),monthsShort:"\u0f5f\u0fb3\u0f0b1_\u0f5f\u0fb3\u0f0b2_\u0f5f\u0fb3\u0f0b3_\u0f5f\u0fb3\u0f0b4_\u0f5f\u0fb3\u0f0b5_\u0f5f\u0fb3\u0f0b6_\u0f5f\u0fb3\u0f0b7_\u0f5f\u0fb3\u0f0b8_\u0f5f\u0fb3\u0f0b9_\u0f5f\u0fb3\u0f0b10_\u0f5f\u0fb3\u0f0b11_\u0f5f\u0fb3\u0f0b12".split("_"),monthsShortRegex:/^(\u0f5f\u0fb3\u0f0b\d{1,2})/,monthsParseExact:!0,weekdays:"\u0f42\u0f5f\u0f60\u0f0b\u0f49\u0f72\u0f0b\u0f58\u0f0b_\u0f42\u0f5f\u0f60\u0f0b\u0f5f\u0fb3\u0f0b\u0f56\u0f0b_\u0f42\u0f5f\u0f60\u0f0b\u0f58\u0f72\u0f42\u0f0b\u0f51\u0f58\u0f62\u0f0b_\u0f42\u0f5f\u0f60\u0f0b\u0f63\u0fb7\u0f42\u0f0b\u0f54\u0f0b_\u0f42\u0f5f\u0f60\u0f0b\u0f55\u0f74\u0f62\u0f0b\u0f56\u0f74_\u0f42\u0f5f\u0f60\u0f0b\u0f54\u0f0b\u0f66\u0f44\u0f66\u0f0b_\u0f42\u0f5f\u0f60\u0f0b\u0f66\u0fa4\u0f7a\u0f53\u0f0b\u0f54\u0f0b".split("_"),weekdaysShort:"\u0f49\u0f72\u0f0b\u0f58\u0f0b_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b_\u0f58\u0f72\u0f42\u0f0b\u0f51\u0f58\u0f62\u0f0b_\u0f63\u0fb7\u0f42\u0f0b\u0f54\u0f0b_\u0f55\u0f74\u0f62\u0f0b\u0f56\u0f74_\u0f54\u0f0b\u0f66\u0f44\u0f66\u0f0b_\u0f66\u0fa4\u0f7a\u0f53\u0f0b\u0f54\u0f0b".split("_"),weekdaysMin:"\u0f49\u0f72_\u0f5f\u0fb3_\u0f58\u0f72\u0f42_\u0f63\u0fb7\u0f42_\u0f55\u0f74\u0f62_\u0f66\u0f44\u0f66_\u0f66\u0fa4\u0f7a\u0f53".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[\u0f51\u0f72\u0f0b\u0f62\u0f72\u0f44] LT",nextDay:"[\u0f66\u0f44\u0f0b\u0f49\u0f72\u0f53] LT",nextWeek:"[\u0f56\u0f51\u0f74\u0f53\u0f0b\u0f55\u0fb2\u0f42\u0f0b\u0f62\u0f97\u0f7a\u0f66\u0f0b\u0f58], LT",lastDay:"[\u0f41\u0f0b\u0f66\u0f44] LT",lastWeek:"[\u0f56\u0f51\u0f74\u0f53\u0f0b\u0f55\u0fb2\u0f42\u0f0b\u0f58\u0f50\u0f60\u0f0b\u0f58] dddd, LT",sameElse:"L"},relativeTime:{future:"%s \u0f63\u0f0b",past:"%s \u0f66\u0f94\u0f53\u0f0b\u0f63",s:"\u0f63\u0f58\u0f0b\u0f66\u0f44",ss:"%d \u0f66\u0f90\u0f62\u0f0b\u0f46\u0f0d",m:"\u0f66\u0f90\u0f62\u0f0b\u0f58\u0f0b\u0f42\u0f45\u0f72\u0f42",mm:"%d \u0f66\u0f90\u0f62\u0f0b\u0f58",h:"\u0f46\u0f74\u0f0b\u0f5a\u0f7c\u0f51\u0f0b\u0f42\u0f45\u0f72\u0f42",hh:"%d \u0f46\u0f74\u0f0b\u0f5a\u0f7c\u0f51",d:"\u0f49\u0f72\u0f53\u0f0b\u0f42\u0f45\u0f72\u0f42",dd:"%d \u0f49\u0f72\u0f53\u0f0b",M:"\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f42\u0f45\u0f72\u0f42",MM:"%d \u0f5f\u0fb3\u0f0b\u0f56",y:"\u0f63\u0f7c\u0f0b\u0f42\u0f45\u0f72\u0f42",yy:"%d \u0f63\u0f7c"},preparse:function(e){return e.replace(/[\u0f21\u0f22\u0f23\u0f24\u0f25\u0f26\u0f27\u0f28\u0f29\u0f20]/g,function(e){return f[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return T[e]})},meridiemParse:/\u0f58\u0f5a\u0f53\u0f0b\u0f58\u0f7c|\u0f5e\u0f7c\u0f42\u0f66\u0f0b\u0f40\u0f66|\u0f49\u0f72\u0f53\u0f0b\u0f42\u0f74\u0f44|\u0f51\u0f42\u0f7c\u0f44\u0f0b\u0f51\u0f42|\u0f58\u0f5a\u0f53\u0f0b\u0f58\u0f7c/,meridiemHour:function(e,a){return 12===e&&(e=0),"\u0f58\u0f5a\u0f53\u0f0b\u0f58\u0f7c"===a&&4<=e||"\u0f49\u0f72\u0f53\u0f0b\u0f42\u0f74\u0f44"===a&&e<5||"\u0f51\u0f42\u0f7c\u0f44\u0f0b\u0f51\u0f42"===a?e+12:e},meridiem:function(e,a,_){return e<4?"\u0f58\u0f5a\u0f53\u0f0b\u0f58\u0f7c":e<10?"\u0f5e\u0f7c\u0f42\u0f66\u0f0b\u0f40\u0f66":e<17?"\u0f49\u0f72\u0f53\u0f0b\u0f42\u0f74\u0f44":e<20?"\u0f51\u0f42\u0f7c\u0f44\u0f0b\u0f51\u0f42":"\u0f58\u0f5a\u0f53\u0f0b\u0f58\u0f7c"},week:{dow:0,doy:6}});var w=[/^gen/i,/^c[\u02bc\']hwe/i,/^meu/i,/^ebr/i,/^mae/i,/^(mez|eve)/i,/^gou/i,/^eos/i,/^gwe/i,/^her/i,/^du/i,/^ker/i],H=/^(genver|c[\u02bc\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu|gen|c[\u02bc\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,b=[/^Su/i,/^Lu/i,/^Me([^r]|$)/i,/^Mer/i,/^Ya/i,/^Gw/i,/^Sa/i];function v(e,a,_){var s=e+" ";switch(_){case"ss":return s+=1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi";case"m":return a?"jedna minuta":"jedne minute";case"mm":return s+=1!==e&&(2===e||3===e||4===e)?"minute":"minuta";case"h":return a?"jedan sat":"jednog sata";case"hh":return s+=1===e?"sat":2===e||3===e||4===e?"sata":"sati";case"dd":return s+=1===e?"dan":"dana";case"MM":return s+=1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci";case"yy":return s+=1!==e&&(2===e||3===e||4===e)?"godine":"godina"}}e.defineLocale("br",{months:"Genver_C\u02bchwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_C\u02bchwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Merc\u02bcher_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),weekdaysParse:b,fullWeekdaysParse:[/^sul/i,/^lun/i,/^meurzh/i,/^merc[\u02bc\']her/i,/^yaou/i,/^gwener/i,/^sadorn/i],shortWeekdaysParse:[/^Sul/i,/^Lun/i,/^Meu/i,/^Mer/i,/^Yao/i,/^Gwe/i,/^Sad/i],minWeekdaysParse:b,monthsRegex:H,monthsShortRegex:H,monthsStrictRegex:/^(genver|c[\u02bc\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu)/i,monthsShortStrictRegex:/^(gen|c[\u02bc\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,monthsParse:w,longMonthsParse:w,shortMonthsParse:w,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY HH:mm",LLLL:"dddd, D [a viz] MMMM YYYY HH:mm"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warc\u02bchoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Dec\u02bch da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s \u02bczo",s:"un nebeud segondenno\xf9",ss:"%d eilenn",m:"ur vunutenn",mm:g,h:"un eur",hh:"%d eur",d:"un devezh",dd:g,M:"ur miz",MM:g,y:"ur bloaz",yy:function(e){switch(function e(a){if(9= 3 ? hour : hour + 12; + } else if (meridiem === 'বিকাল') { + return hour + 12; + } else if (meridiem === 'সন্ধ্যা') { + return hour + 12; + } + }, + + meridiem: function (hour, minute, isLower) { + if (hour < 4) { + return 'রাত'; + } else if (hour < 6) { + return 'ভোর'; + } else if (hour < 12) { + return 'সকাল'; + } else if (hour < 15) { + return 'দুপুর'; + } else if (hour < 18) { + return 'বিকাল'; + } else if (hour < 20) { + return 'সন্ধ্যা'; + } else { + return 'রাত'; + } + }, + week: { + dow: 0, // Sunday is the first day of the week. + doy: 6, // The week that contains Jan 6th is the first week of the year. + }, + }); + + //! moment.js locale configuration + + var symbolMap$4 = { + 1: '১', + 2: '২', + 3: '৩', + 4: '৪', + 5: '৫', + 6: '৬', + 7: '৭', + 8: '৮', + 9: '৯', + 0: '০', + }, + numberMap$3 = { + '১': '1', + '২': '2', + '৩': '3', + '৪': '4', + '৫': '5', + '৬': '6', + '৭': '7', + '৮': '8', + '৯': '9', + '০': '0', + }; + + hooks.defineLocale('bn', { + months: 'জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split( + '_' + ), + monthsShort: 'জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে'.split( + '_' + ), + weekdays: 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার'.split( + '_' + ), + weekdaysShort: 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি'.split('_'), + weekdaysMin: 'রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি'.split('_'), + longDateFormat: { + LT: 'A h:mm সময়', + LTS: 'A h:mm:ss সময়', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY, A h:mm সময়', + LLLL: 'dddd, D MMMM YYYY, A h:mm সময়', + }, + calendar: { + sameDay: '[আজ] LT', + nextDay: '[আগামীকাল] LT', + nextWeek: 'dddd, LT', + lastDay: '[গতকাল] LT', + lastWeek: '[গত] dddd, LT', + sameElse: 'L', + }, + relativeTime: { + future: '%s পরে', + past: '%s আগে', + s: 'কয়েক সেকেন্ড', + ss: '%d সেকেন্ড', + m: 'এক মিনিট', + mm: '%d মিনিট', + h: 'এক ঘন্টা', + hh: '%d ঘন্টা', + d: 'এক দিন', + dd: '%d দিন', + M: 'এক মাস', + MM: '%d মাস', + y: 'এক বছর', + yy: '%d বছর', + }, + preparse: function (string) { + return string.replace(/[১২৩৪৫৬৭৮৯০]/g, function (match) { + return numberMap$3[match]; + }); + }, + postformat: function (string) { + return string.replace(/\d/g, function (match) { + return symbolMap$4[match]; + }); + }, meridiemParse: /রাত|সকাল|দুপুর|বিকাল|রাত/, meridiemHour: function (hour, meridiem) { if (hour === 12) { @@ -6961,19 +7091,19 @@ //! moment.js locale configuration - var symbolMap$4 = { - '1': '༡', - '2': '༢', - '3': '༣', - '4': '༤', - '5': '༥', - '6': '༦', - '7': '༧', - '8': '༨', - '9': '༩', - '0': '༠', + var symbolMap$5 = { + 1: '༡', + 2: '༢', + 3: '༣', + 4: '༤', + 5: '༥', + 6: '༦', + 7: '༧', + 8: '༨', + 9: '༩', + 0: '༠', }, - numberMap$3 = { + numberMap$4 = { '༡': '1', '༢': '2', '༣': '3', @@ -7036,12 +7166,12 @@ }, preparse: function (string) { return string.replace(/[༡༢༣༤༥༦༧༨༩༠]/g, function (match) { - return numberMap$3[match]; + return numberMap$4[match]; }); }, postformat: function (string) { return string.replace(/\d/g, function (match) { - return symbolMap$4[match]; + return symbolMap$5[match]; }); }, meridiemParse: /མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/, @@ -8917,6 +9047,8 @@ hh: '%d horas', d: 'un día', dd: '%d días', + w: 'una semana', + ww: '%d semanas', M: 'un mes', MM: '%d meses', y: 'un año', @@ -8952,7 +9084,7 @@ ], monthsRegex$4 = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i; - hooks.defineLocale('es-us', { + hooks.defineLocale('es-mx', { months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split( '_' ), @@ -8977,12 +9109,12 @@ weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'), weekdaysParseExact: true, longDateFormat: { - LT: 'h:mm A', - LTS: 'h:mm:ss A', - L: 'MM/DD/YYYY', + LT: 'H:mm', + LTS: 'H:mm:ss', + L: 'DD/MM/YYYY', LL: 'D [de] MMMM [de] YYYY', - LLL: 'D [de] MMMM [de] YYYY h:mm A', - LLLL: 'dddd, D [de] MMMM [de] YYYY h:mm A', + LLL: 'D [de] MMMM [de] YYYY H:mm', + LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm', }, calendar: { sameDay: function () { @@ -9017,6 +9149,8 @@ hh: '%d horas', d: 'un día', dd: '%d días', + w: 'una semana', + ww: '%d semanas', M: 'un mes', MM: '%d meses', y: 'un año', @@ -9026,8 +9160,9 @@ ordinal: '%dº', week: { dow: 0, // Sunday is the first day of the week. - doy: 6, // The week that contains Jan 6th is the first week of the year. + doy: 4, // The week that contains Jan 4th is the first week of the year. }, + invalidDate: 'Fecha inválida', }); //! moment.js locale configuration @@ -9052,7 +9187,7 @@ ], monthsRegex$5 = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i; - hooks.defineLocale('es', { + hooks.defineLocale('es-us', { months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split( '_' ), @@ -9076,6 +9211,108 @@ weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'), weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'), weekdaysParseExact: true, + longDateFormat: { + LT: 'h:mm A', + LTS: 'h:mm:ss A', + L: 'MM/DD/YYYY', + LL: 'D [de] MMMM [de] YYYY', + LLL: 'D [de] MMMM [de] YYYY h:mm A', + LLLL: 'dddd, D [de] MMMM [de] YYYY h:mm A', + }, + calendar: { + sameDay: function () { + return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; + }, + nextDay: function () { + return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; + }, + nextWeek: function () { + return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; + }, + lastDay: function () { + return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; + }, + lastWeek: function () { + return ( + '[el] dddd [pasado a la' + + (this.hours() !== 1 ? 's' : '') + + '] LT' + ); + }, + sameElse: 'L', + }, + relativeTime: { + future: 'en %s', + past: 'hace %s', + s: 'unos segundos', + ss: '%d segundos', + m: 'un minuto', + mm: '%d minutos', + h: 'una hora', + hh: '%d horas', + d: 'un día', + dd: '%d días', + w: 'una semana', + ww: '%d semanas', + M: 'un mes', + MM: '%d meses', + y: 'un año', + yy: '%d años', + }, + dayOfMonthOrdinalParse: /\d{1,2}º/, + ordinal: '%dº', + week: { + dow: 0, // Sunday is the first day of the week. + doy: 6, // The week that contains Jan 6th is the first week of the year. + }, + }); + + //! moment.js locale configuration + + var monthsShortDot$3 = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split( + '_' + ), + monthsShort$4 = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'), + monthsParse$5 = [ + /^ene/i, + /^feb/i, + /^mar/i, + /^abr/i, + /^may/i, + /^jun/i, + /^jul/i, + /^ago/i, + /^sep/i, + /^oct/i, + /^nov/i, + /^dic/i, + ], + monthsRegex$6 = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i; + + hooks.defineLocale('es', { + months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split( + '_' + ), + monthsShort: function (m, format) { + if (!m) { + return monthsShortDot$3; + } else if (/-MMM-/.test(format)) { + return monthsShort$4[m.month()]; + } else { + return monthsShortDot$3[m.month()]; + } + }, + monthsRegex: monthsRegex$6, + monthsShortRegex: monthsRegex$6, + monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i, + monthsShortStrictRegex: /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i, + monthsParse: monthsParse$5, + longMonthsParse: monthsParse$5, + shortMonthsParse: monthsParse$5, + weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'), + weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'), + weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'), + weekdaysParseExact: true, longDateFormat: { LT: 'H:mm', LTS: 'H:mm:ss', @@ -9117,6 +9354,8 @@ hh: '%d horas', d: 'un día', dd: '%d días', + w: 'una semana', + ww: '%d semanas', M: 'un mes', MM: '%d meses', y: 'un año', @@ -9267,19 +9506,19 @@ //! moment.js locale configuration - var symbolMap$5 = { - '1': '۱', - '2': '۲', - '3': '۳', - '4': '۴', - '5': '۵', - '6': '۶', - '7': '۷', - '8': '۸', - '9': '۹', - '0': '۰', + var symbolMap$6 = { + 1: '۱', + 2: '۲', + 3: '۳', + 4: '۴', + 5: '۵', + 6: '۶', + 7: '۷', + 8: '۸', + 9: '۹', + 0: '۰', }, - numberMap$4 = { + numberMap$5 = { '۱': '1', '۲': '2', '۳': '3', @@ -9353,14 +9592,14 @@ preparse: function (string) { return string .replace(/[۰-۹]/g, function (match) { - return numberMap$4[match]; + return numberMap$5[match]; }) .replace(/،/g, ','); }, postformat: function (string) { return string .replace(/\d/g, function (match) { - return symbolMap$5[match]; + return symbolMap$6[match]; }) .replace(/,/g, '،'); }, @@ -9736,8 +9975,8 @@ var monthsStrictRegex$1 = /^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i, monthsShortStrictRegex$1 = /(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?)/i, - monthsRegex$6 = /(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?|janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i, - monthsParse$5 = [ + monthsRegex$7 = /(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?|janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i, + monthsParse$6 = [ /^janv/i, /^févr/i, /^mars/i, @@ -9759,13 +9998,13 @@ monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split( '_' ), - monthsRegex: monthsRegex$6, - monthsShortRegex: monthsRegex$6, + monthsRegex: monthsRegex$7, + monthsShortRegex: monthsRegex$7, monthsStrictRegex: monthsStrictRegex$1, monthsShortStrictRegex: monthsShortStrictRegex$1, - monthsParse: monthsParse$5, - longMonthsParse: monthsParse$5, - shortMonthsParse: monthsParse$5, + monthsParse: monthsParse$6, + longMonthsParse: monthsParse$6, + shortMonthsParse: monthsParse$6, weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'), weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'), weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'), @@ -9797,6 +10036,8 @@ hh: '%d heures', d: 'un jour', dd: '%d jours', + w: 'une semaine', + ww: '%d semaines', M: 'un mois', MM: '%d mois', y: 'un an', @@ -9921,7 +10162,7 @@ 'Samhain', 'Nollaig', ], - monthsShort$4 = [ + monthsShort$5 = [ 'Ean', 'Feabh', 'Márt', @@ -9949,7 +10190,7 @@ hooks.defineLocale('ga', { months: months$6, - monthsShort: monthsShort$4, + monthsShort: monthsShort$5, monthsParseExact: true, weekdays: weekdays$1, weekdaysShort: weekdaysShort, @@ -10013,7 +10254,7 @@ 'An t-Samhain', 'An Dùbhlachd', ], - monthsShort$5 = [ + monthsShort$6 = [ 'Faoi', 'Gear', 'Màrt', @@ -10041,7 +10282,7 @@ hooks.defineLocale('gd', { months: months$7, - monthsShort: monthsShort$5, + monthsShort: monthsShort$6, monthsParseExact: true, weekdays: weekdays$2, weekdaysShort: weekdaysShort$1, @@ -10404,19 +10645,19 @@ //! moment.js locale configuration - var symbolMap$6 = { - '1': '૧', - '2': '૨', - '3': '૩', - '4': '૪', - '5': '૫', - '6': '૬', - '7': '૭', - '8': '૮', - '9': '૯', - '0': '૦', + var symbolMap$7 = { + 1: '૧', + 2: '૨', + 3: '૩', + 4: '૪', + 5: '૫', + 6: '૬', + 7: '૭', + 8: '૮', + 9: '૯', + 0: '૦', }, - numberMap$5 = { + numberMap$6 = { '૧': '1', '૨': '2', '૩': '3', @@ -10476,12 +10717,12 @@ }, preparse: function (string) { return string.replace(/[૧૨૩૪૫૬૭૮૯૦]/g, function (match) { - return numberMap$5[match]; + return numberMap$6[match]; }); }, postformat: function (string) { return string.replace(/\d/g, function (match) { - return symbolMap$6[match]; + return symbolMap$7[match]; }); }, // Gujarati notation for meridiems are quite fuzzy in practice. While there exists @@ -10611,19 +10852,19 @@ //! moment.js locale configuration - var symbolMap$7 = { - '1': '१', - '2': '२', - '3': '३', - '4': '४', - '5': '५', - '6': '६', - '7': '७', - '8': '८', - '9': '९', - '0': '०', + var symbolMap$8 = { + 1: '१', + 2: '२', + 3: '३', + 4: '४', + 5: '५', + 6: '६', + 7: '७', + 8: '८', + 9: '९', + 0: '०', }, - numberMap$6 = { + numberMap$7 = { '१': '1', '२': '2', '३': '3', @@ -10681,12 +10922,12 @@ }, preparse: function (string) { return string.replace(/[१२३४५६७८९०]/g, function (match) { - return numberMap$6[match]; + return numberMap$7[match]; }); }, postformat: function (string) { return string.replace(/\d/g, function (match) { - return symbolMap$7[match]; + return symbolMap$8[match]; }); }, // Hindi notation for meridiems are quite fuzzy in practice. While there exists @@ -10928,9 +11169,10 @@ months: 'január_február_március_április_május_június_július_augusztus_szeptember_október_november_december'.split( '_' ), - monthsShort: 'jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec'.split( + monthsShort: 'jan._feb._márc._ápr._máj._jún._júl._aug._szept._okt._nov._dec.'.split( '_' ), + monthsParseExact: true, weekdays: 'vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat'.split('_'), weekdaysShort: 'vas_hét_kedd_sze_csüt_pén_szo'.split('_'), weekdaysMin: 'v_h_k_sze_cs_p_szo'.split('_'), @@ -11433,6 +11675,8 @@ hh: '%d ore', d: 'un giorno', dd: '%d giorni', + w: 'una settimana', + ww: '%d settimane', M: 'un mese', MM: '%d mesi', y: 'un anno', @@ -11833,19 +12077,19 @@ //! moment.js locale configuration - var symbolMap$8 = { - '1': '១', - '2': '២', - '3': '៣', - '4': '៤', - '5': '៥', - '6': '៦', - '7': '៧', - '8': '៨', - '9': '៩', - '0': '០', + var symbolMap$9 = { + 1: '១', + 2: '២', + 3: '៣', + 4: '៤', + 5: '៥', + 6: '៦', + 7: '៧', + 8: '៨', + 9: '៩', + 0: '០', }, - numberMap$7 = { + numberMap$8 = { '១': '1', '២': '2', '៣': '3', @@ -11916,12 +12160,12 @@ ordinal: 'ទី%d', preparse: function (string) { return string.replace(/[១២៣៤៥៦៧៨៩០]/g, function (match) { - return numberMap$7[match]; + return numberMap$8[match]; }); }, postformat: function (string) { return string.replace(/\d/g, function (match) { - return symbolMap$8[match]; + return symbolMap$9[match]; }); }, week: { @@ -11932,19 +12176,19 @@ //! moment.js locale configuration - var symbolMap$9 = { - '1': '೧', - '2': '೨', - '3': '೩', - '4': '೪', - '5': '೫', - '6': '೬', - '7': '೭', - '8': '೮', - '9': '೯', - '0': '೦', + var symbolMap$a = { + 1: '೧', + 2: '೨', + 3: '೩', + 4: '೪', + 5: '೫', + 6: '೬', + 7: '೭', + 8: '೮', + 9: '೯', + 0: '೦', }, - numberMap$8 = { + numberMap$9 = { '೧': '1', '೨': '2', '೩': '3', @@ -12004,12 +12248,12 @@ }, preparse: function (string) { return string.replace(/[೧೨೩೪೫೬೭೮೯೦]/g, function (match) { - return numberMap$8[match]; + return numberMap$9[match]; }); }, postformat: function (string) { return string.replace(/\d/g, function (match) { - return symbolMap$9[match]; + return symbolMap$a[match]; }); }, meridiemParse: /ರಾತ್ರಿ|ಬೆಳಿಗ್ಗೆ|ಮಧ್ಯಾಹ್ನ|ಸಂಜೆ/, @@ -12123,19 +12367,19 @@ //! moment.js locale configuration - var symbolMap$a = { - '1': '١', - '2': '٢', - '3': '٣', - '4': '٤', - '5': '٥', - '6': '٦', - '7': '٧', - '8': '٨', - '9': '٩', - '0': '٠', + var symbolMap$b = { + 1: '١', + 2: '٢', + 3: '٣', + 4: '٤', + 5: '٥', + 6: '٦', + 7: '٧', + 8: '٨', + 9: '٩', + 0: '٠', }, - numberMap$9 = { + numberMap$a = { '١': '1', '٢': '2', '٣': '3', @@ -12219,14 +12463,14 @@ preparse: function (string) { return string .replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) { - return numberMap$9[match]; + return numberMap$a[match]; }) .replace(/،/g, ','); }, postformat: function (string) { return string .replace(/\d/g, function (match) { - return symbolMap$a[match]; + return symbolMap$b[match]; }) .replace(/,/g, '،'); }, @@ -13147,19 +13391,19 @@ //! moment.js locale configuration - var symbolMap$b = { - '1': '१', - '2': '२', - '3': '३', - '4': '४', - '5': '५', - '6': '६', - '7': '७', - '8': '८', - '9': '९', - '0': '०', + var symbolMap$c = { + 1: '१', + 2: '२', + 3: '३', + 4: '४', + 5: '५', + 6: '६', + 7: '७', + 8: '८', + 9: '९', + 0: '०', }, - numberMap$a = { + numberMap$b = { '१': '1', '२': '2', '३': '3', @@ -13301,12 +13545,12 @@ }, preparse: function (string) { return string.replace(/[१२३४५६७८९०]/g, function (match) { - return numberMap$a[match]; + return numberMap$b[match]; }); }, postformat: function (string) { return string.replace(/\d/g, function (match) { - return symbolMap$b[match]; + return symbolMap$c[match]; }); }, meridiemParse: /पहाटे|सकाळी|दुपारी|सायंकाळी|रात्री/, @@ -13541,19 +13785,19 @@ //! moment.js locale configuration - var symbolMap$c = { - '1': '၁', - '2': '၂', - '3': '၃', - '4': '၄', - '5': '၅', - '6': '၆', - '7': '၇', - '8': '၈', - '9': '၉', - '0': '၀', + var symbolMap$d = { + 1: '၁', + 2: '၂', + 3: '၃', + 4: '၄', + 5: '၅', + 6: '၆', + 7: '၇', + 8: '၈', + 9: '၉', + 0: '၀', }, - numberMap$b = { + numberMap$c = { '၁': '1', '၂': '2', '၃': '3', @@ -13611,12 +13855,12 @@ }, preparse: function (string) { return string.replace(/[၁၂၃၄၅၆၇၈၉၀]/g, function (match) { - return numberMap$b[match]; + return numberMap$c[match]; }); }, postformat: function (string) { return string.replace(/\d/g, function (match) { - return symbolMap$c[match]; + return symbolMap$d[match]; }); }, week: { @@ -13666,6 +13910,8 @@ hh: '%d timer', d: 'en dag', dd: '%d dager', + w: 'en uke', + ww: '%d uker', M: 'en måned', MM: '%d måneder', y: 'ett år', @@ -13681,19 +13927,19 @@ //! moment.js locale configuration - var symbolMap$d = { - '1': '१', - '2': '२', - '3': '३', - '4': '४', - '5': '५', - '6': '६', - '7': '७', - '8': '८', - '9': '९', - '0': '०', + var symbolMap$e = { + 1: '१', + 2: '२', + 3: '३', + 4: '४', + 5: '५', + 6: '६', + 7: '७', + 8: '८', + 9: '९', + 0: '०', }, - numberMap$c = { + numberMap$d = { '१': '1', '२': '2', '३': '3', @@ -13730,12 +13976,12 @@ }, preparse: function (string) { return string.replace(/[१२३४५६७८९०]/g, function (match) { - return numberMap$c[match]; + return numberMap$d[match]; }); }, postformat: function (string) { return string.replace(/\d/g, function (match) { - return symbolMap$d[match]; + return symbolMap$e[match]; }); }, meridiemParse: /राति|बिहान|दिउँसो|साँझ/, @@ -13804,7 +14050,7 @@ monthsShortWithoutDots$1 = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split( '_' ), - monthsParse$6 = [ + monthsParse$7 = [ /^jan/i, /^feb/i, /^maart|mrt.?$/i, @@ -13818,7 +14064,7 @@ /^nov/i, /^dec/i, ], - monthsRegex$7 = /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i; + monthsRegex$8 = /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i; hooks.defineLocale('nl-be', { months: 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split( @@ -13834,14 +14080,14 @@ } }, - monthsRegex: monthsRegex$7, - monthsShortRegex: monthsRegex$7, + monthsRegex: monthsRegex$8, + monthsShortRegex: monthsRegex$8, monthsStrictRegex: /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i, monthsShortStrictRegex: /^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i, - monthsParse: monthsParse$6, - longMonthsParse: monthsParse$6, - shortMonthsParse: monthsParse$6, + monthsParse: monthsParse$7, + longMonthsParse: monthsParse$7, + shortMonthsParse: monthsParse$7, weekdays: 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split( '_' @@ -13902,7 +14148,7 @@ monthsShortWithoutDots$2 = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split( '_' ), - monthsParse$7 = [ + monthsParse$8 = [ /^jan/i, /^feb/i, /^maart|mrt.?$/i, @@ -13916,7 +14162,7 @@ /^nov/i, /^dec/i, ], - monthsRegex$8 = /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i; + monthsRegex$9 = /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i; hooks.defineLocale('nl', { months: 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split( @@ -13932,14 +14178,14 @@ } }, - monthsRegex: monthsRegex$8, - monthsShortRegex: monthsRegex$8, + monthsRegex: monthsRegex$9, + monthsShortRegex: monthsRegex$9, monthsStrictRegex: /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i, monthsShortStrictRegex: /^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i, - monthsParse: monthsParse$7, - longMonthsParse: monthsParse$7, - shortMonthsParse: monthsParse$7, + monthsParse: monthsParse$8, + longMonthsParse: monthsParse$8, + shortMonthsParse: monthsParse$8, weekdays: 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split( '_' @@ -13974,6 +14220,8 @@ hh: '%d uur', d: 'één dag', dd: '%d dagen', + w: 'één week', + ww: '%d weken', M: 'één maand', MM: '%d maanden', y: 'één jaar', @@ -14033,6 +14281,8 @@ hh: '%d timar', d: 'ein dag', dd: '%d dagar', + w: 'ei veke', + ww: '%d veker', M: 'ein månad', MM: '%d månader', y: 'eit år', @@ -14128,19 +14378,19 @@ //! moment.js locale configuration - var symbolMap$e = { - '1': '੧', - '2': '੨', - '3': '੩', - '4': '੪', - '5': '੫', - '6': '੬', - '7': '੭', - '8': '੮', - '9': '੯', - '0': '੦', + var symbolMap$f = { + 1: '੧', + 2: '੨', + 3: '੩', + 4: '੪', + 5: '੫', + 6: '੬', + 7: '੭', + 8: '੮', + 9: '੯', + 0: '੦', }, - numberMap$d = { + numberMap$e = { '੧': '1', '੨': '2', '੩': '3', @@ -14200,12 +14450,12 @@ }, preparse: function (string) { return string.replace(/[੧੨੩੪੫੬੭੮੯੦]/g, function (match) { - return numberMap$d[match]; + return numberMap$e[match]; }); }, postformat: function (string) { return string.replace(/\d/g, function (match) { - return symbolMap$e[match]; + return symbolMap$f[match]; }); }, // Punjabi notation for meridiems are quite fuzzy in practice. While there exists @@ -14251,7 +14501,21 @@ ), monthsSubjective = 'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia'.split( '_' - ); + ), + monthsParse$9 = [ + /^sty/i, + /^lut/i, + /^mar/i, + /^kwi/i, + /^maj/i, + /^cze/i, + /^lip/i, + /^sie/i, + /^wrz/i, + /^paź/i, + /^lis/i, + /^gru/i, + ]; function plural$3(n) { return n % 10 < 5 && n % 10 > 1 && ~~(n / 10) % 10 !== 1; } @@ -14268,6 +14532,8 @@ return withoutSuffix ? 'godzina' : 'godzinę'; case 'hh': return result + (plural$3(number) ? 'godziny' : 'godzin'); + case 'ww': + return result + (plural$3(number) ? 'tygodnie' : 'tygodni'); case 'MM': return result + (plural$3(number) ? 'miesiące' : 'miesięcy'); case 'yy': @@ -14279,17 +14545,6 @@ months: function (momentToFormat, format) { if (!momentToFormat) { return monthsNominative; - } else if (format === '') { - // Hack: if format empty we know this is used to generate - // RegExp by moment. Give then back both valid forms of months - // in RegExp ready format. - return ( - '(' + - monthsSubjective[momentToFormat.month()] + - '|' + - monthsNominative[momentToFormat.month()] + - ')' - ); } else if (/D MMMM/.test(format)) { return monthsSubjective[momentToFormat.month()]; } else { @@ -14297,6 +14552,9 @@ } }, monthsShort: 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'), + monthsParse: monthsParse$9, + longMonthsParse: monthsParse$9, + shortMonthsParse: monthsParse$9, weekdays: 'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split( '_' ), @@ -14357,6 +14615,8 @@ hh: translate$8, d: '1 dzień', dd: '%d dni', + w: 'tydzień', + ww: translate$8, M: 'miesiąc', MM: translate$8, y: 'rok', @@ -14421,6 +14681,7 @@ }, dayOfMonthOrdinalParse: /\d{1,2}º/, ordinal: '%dº', + invalidDate: 'Data inválida', }); //! moment.js locale configuration @@ -14467,6 +14728,8 @@ hh: '%d horas', d: 'um dia', dd: '%d dias', + w: 'uma semana', + ww: '%d semanas', M: 'um mês', MM: '%d meses', y: 'um ano', @@ -14488,6 +14751,7 @@ mm: 'minute', hh: 'ore', dd: 'zile', + ww: 'săptămâni', MM: 'luni', yy: 'ani', }, @@ -14536,6 +14800,8 @@ hh: relativeTimeWithPlural$2, d: 'o zi', dd: relativeTimeWithPlural$2, + w: 'o săptămână', + ww: relativeTimeWithPlural$2, M: 'o lună', MM: relativeTimeWithPlural$2, y: 'un an', @@ -14563,6 +14829,7 @@ mm: withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут', hh: 'час_часа_часов', dd: 'день_дня_дней', + ww: 'неделя_недели_недель', MM: 'месяц_месяца_месяцев', yy: 'год_года_лет', }; @@ -14572,7 +14839,7 @@ return number + ' ' + plural$4(format[key], +number); } } - var monthsParse$8 = [ + var monthsParse$a = [ /^янв/i, /^фев/i, /^мар/i, @@ -14619,9 +14886,9 @@ }, weekdaysShort: 'вс_пн_вт_ср_чт_пт_сб'.split('_'), weekdaysMin: 'вс_пн_вт_ср_чт_пт_сб'.split('_'), - monthsParse: monthsParse$8, - longMonthsParse: monthsParse$8, - shortMonthsParse: monthsParse$8, + monthsParse: monthsParse$a, + longMonthsParse: monthsParse$a, + shortMonthsParse: monthsParse$a, // полные названия с падежами, по три буквы, для некоторых, по 4 буквы, сокращения с точкой и без точки monthsRegex: /^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i, @@ -14703,6 +14970,8 @@ hh: relativeTimeWithPlural$3, d: 'день', dd: relativeTimeWithPlural$3, + w: 'неделя', + ww: relativeTimeWithPlural$3, M: 'месяц', MM: relativeTimeWithPlural$3, y: 'год', @@ -14947,7 +15216,7 @@ var months$a = 'január_február_marec_apríl_máj_jún_júl_august_september_október_november_december'.split( '_' ), - monthsShort$6 = 'jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec'.split('_'); + monthsShort$7 = 'jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec'.split('_'); function plural$5(n) { return n > 1 && n < 5; } @@ -15007,7 +15276,7 @@ hooks.defineLocale('sk', { months: months$a, - monthsShort: monthsShort$6, + monthsShort: monthsShort$7, weekdays: 'nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota'.split('_'), weekdaysShort: 'ne_po_ut_st_št_pi_so'.split('_'), weekdaysMin: 'ne_po_ut_st_št_pi_so'.split('_'), @@ -15359,10 +15628,10 @@ longDateFormat: { LT: 'H:mm', LTS: 'H:mm:ss', - L: 'DD.MM.YYYY', - LL: 'D. MMMM YYYY', - LLL: 'D. MMMM YYYY H:mm', - LLLL: 'dddd, D. MMMM YYYY H:mm', + L: 'D. M. YYYY.', + LL: 'D. MMMM YYYY.', + LLL: 'D. MMMM YYYY. H:mm', + LLLL: 'dddd, D. MMMM YYYY. H:mm', }, calendar: { sameDay: '[данас у] LT', @@ -15417,7 +15686,7 @@ ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. - doy: 7, // The week that contains Jan 7th is the first week of the year. + doy: 7, // The week that contains Jan 1st is the first week of the year. }, }); @@ -15473,10 +15742,10 @@ longDateFormat: { LT: 'H:mm', LTS: 'H:mm:ss', - L: 'DD.MM.YYYY', - LL: 'D. MMMM YYYY', - LLL: 'D. MMMM YYYY H:mm', - LLLL: 'dddd, D. MMMM YYYY H:mm', + L: 'D. M. YYYY.', + LL: 'D. MMMM YYYY.', + LLL: 'D. MMMM YYYY. H:mm', + LLLL: 'dddd, D. MMMM YYYY. H:mm', }, calendar: { sameDay: '[danas u] LT', @@ -15733,19 +16002,19 @@ //! moment.js locale configuration - var symbolMap$f = { - '1': '௧', - '2': '௨', - '3': '௩', - '4': '௪', - '5': '௫', - '6': '௬', - '7': '௭', - '8': '௮', - '9': '௯', - '0': '௦', - }, - numberMap$e = { + var symbolMap$g = { + 1: '௧', + 2: '௨', + 3: '௩', + 4: '௪', + 5: '௫', + 6: '௬', + 7: '௭', + 8: '௮', + 9: '௯', + 0: '௦', + }, + numberMap$f = { '௧': '1', '௨': '2', '௩': '3', @@ -15810,12 +16079,12 @@ }, preparse: function (string) { return string.replace(/[௧௨௩௪௫௬௭௮௯௦]/g, function (match) { - return numberMap$e[match]; + return numberMap$f[match]; }); }, postformat: function (string) { return string.replace(/\d/g, function (match) { - return symbolMap$f[match]; + return symbolMap$g[match]; }); }, // refer http://ta.wikipedia.org/s/1er1 @@ -16031,9 +16300,14 @@ }; hooks.defineLocale('tg', { - months: 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split( - '_' - ), + months: { + format: 'январи_феврали_марти_апрели_майи_июни_июли_августи_сентябри_октябри_ноябри_декабри'.split( + '_' + ), + standalone: 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split( + '_' + ), + }, monthsShort: 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'), weekdays: 'якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе'.split( '_' @@ -16043,14 +16317,14 @@ longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', - L: 'DD/MM/YYYY', + L: 'DD.MM.YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd, D MMMM YYYY HH:mm', }, calendar: { sameDay: '[Имрӯз соати] LT', - nextDay: '[Пагоҳ соати] LT', + nextDay: '[Фардо соати] LT', lastDay: '[Дирӯз соати] LT', nextWeek: 'dddd[и] [ҳафтаи оянда соати] LT', lastWeek: 'dddd[и] [ҳафтаи гузашта соати] LT', @@ -16163,6 +16437,8 @@ hh: '%d ชั่วโมง', d: '1 วัน', dd: '%d วัน', + w: '1 สัปดาห์', + ww: '%d สัปดาห์', M: '1 เดือน', MM: '%d เดือน', y: '1 ปี', @@ -16505,6 +16781,8 @@ hh: '%d saat', d: 'bir gün', dd: '%d gün', + w: 'bir hafta', + ww: '%d hafta', M: 'bir ay', MM: '%d ay', y: 'bir yıl', @@ -17219,6 +17497,8 @@ hh: '%d giờ', d: 'một ngày', dd: '%d ngày', + w: 'một tuần', + ww: '%d tuần', M: 'một tháng', MM: '%d tháng', y: 'một năm', @@ -17453,6 +17733,8 @@ hh: '%d 小时', d: '1 天', dd: '%d 天', + w: '1 周', + ww: '%d 周', M: '1 个月', MM: '%d 个月', y: '1 年', diff --git a/min/moment-with-locales.min.js b/min/moment-with-locales.min.js index f1f8abad2..521bfb63e 100644 --- a/min/moment-with-locales.min.js +++ b/min/moment-with-locales.min.js @@ -1,2 +1,2 @@ -!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a():"function"==typeof define&&define.amd?define(a):e.moment=a()}(this,function(){"use strict";var e,n;function M(){return e.apply(null,arguments)}function _(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function i(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function h(e,a){return Object.prototype.hasOwnProperty.call(e,a)}function o(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;for(var a in e)if(h(e,a))return;return 1}function r(e){return void 0===e}function m(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function d(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function u(e,a){for(var t=[],s=0;s>>0,s=0;sFe(e)?(r=e+1,d-Fe(e)):(r=e,d);return{year:r,dayOfYear:_}}function Ce(e,a,t){var s,n,r=Je(e.year(),a,t),d=Math.floor((e.dayOfYear()-r-1)/7)+1;return d<1?s=d+Ie(n=e.year()-1,a,t):d>Ie(e.year(),a,t)?(s=d-Ie(e.year(),a,t),n=e.year()+1):(n=e.year(),s=d),{week:s,year:n}}function Ie(e,a,t){var s=Je(e,a,t),n=Je(e+1,a,t);return(Fe(e)-s+n)/7}W("w",["ww",2],"wo","week"),W("W",["WW",2],"Wo","isoWeek"),z("week","w"),z("isoWeek","W"),C("week",5),C("isoWeek",5),le("w",ae),le("ww",ae,$),le("W",ae),le("WW",ae,$),Ye(["w","ww","W","WW"],function(e,a,t,s){a[s.substr(0,1)]=G(e)});function Ue(e,a){return e.slice(a,7).concat(e.slice(0,a))}W("d",0,"do","day"),W("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),W("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),W("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),W("e",0,0,"weekday"),W("E",0,0,"isoWeekday"),z("day","d"),z("weekday","e"),z("isoWeekday","E"),C("day",11),C("weekday",11),C("isoWeekday",11),le("d",ae),le("e",ae),le("E",ae),le("dd",function(e,a){return a.weekdaysMinRegex(e)}),le("ddd",function(e,a){return a.weekdaysShortRegex(e)}),le("dddd",function(e,a){return a.weekdaysRegex(e)}),Ye(["dd","ddd","dddd"],function(e,a,t,s){var n=t._locale.weekdaysParse(e,s,t._strict);null!=n?a.d=n:L(t).invalidWeekday=e}),Ye(["d","e","E"],function(e,a,t,s){a[s]=G(e)});var Ge="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ve="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Be="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Ke=ue,qe=ue,Ze=ue;function $e(){function e(e,a){return a.length-e.length}for(var a,t,s,n,r=[],d=[],_=[],i=[],o=0;o<7;o++)a=c([2e3,1]).day(o),t=he(this.weekdaysMin(a,"")),s=he(this.weekdaysShort(a,"")),n=he(this.weekdays(a,"")),r.push(t),d.push(s),_.push(n),i.push(t),i.push(s),i.push(n);r.sort(e),d.sort(e),_.sort(e),i.sort(e),this._weekdaysRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+_.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+r.join("|")+")","i")}function Qe(){return this.hours()%12||12}function Xe(e,a){W(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),a)})}function ea(e,a){return a._meridiemParse}W("H",["HH",2],0,"hour"),W("h",["hh",2],0,Qe),W("k",["kk",2],0,function(){return this.hours()||24}),W("hmm",0,0,function(){return""+Qe.apply(this)+S(this.minutes(),2)}),W("hmmss",0,0,function(){return""+Qe.apply(this)+S(this.minutes(),2)+S(this.seconds(),2)}),W("Hmm",0,0,function(){return""+this.hours()+S(this.minutes(),2)}),W("Hmmss",0,0,function(){return""+this.hours()+S(this.minutes(),2)+S(this.seconds(),2)}),Xe("a",!0),Xe("A",!1),z("hour","h"),C("hour",13),le("a",ea),le("A",ea),le("H",ae),le("h",ae),le("k",ae),le("HH",ae,$),le("hh",ae,$),le("kk",ae,$),le("hmm",te),le("hmmss",se),le("Hmm",te),le("Hmmss",se),Le(["H","HH"],De),Le(["k","kk"],function(e,a,t){var s=G(e);a[De]=24===s?0:s}),Le(["a","A"],function(e,a,t){t._isPm=t._locale.isPM(e),t._meridiem=e}),Le(["h","hh"],function(e,a,t){a[De]=G(e),L(t).bigHour=!0}),Le("hmm",function(e,a,t){var s=e.length-2;a[De]=G(e.substr(0,s)),a[Te]=G(e.substr(s)),L(t).bigHour=!0}),Le("hmmss",function(e,a,t){var s=e.length-4,n=e.length-2;a[De]=G(e.substr(0,s)),a[Te]=G(e.substr(s,2)),a[ge]=G(e.substr(n)),L(t).bigHour=!0}),Le("Hmm",function(e,a,t){var s=e.length-2;a[De]=G(e.substr(0,s)),a[Te]=G(e.substr(s))}),Le("Hmmss",function(e,a,t){var s=e.length-4,n=e.length-2;a[De]=G(e.substr(0,s)),a[Te]=G(e.substr(s,2)),a[ge]=G(e.substr(n))});var aa=V("Hours",!0);var ta,sa={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Se,monthsShort:je,week:{dow:0,doy:6},weekdays:Ge,weekdaysMin:Be,weekdaysShort:Ve,meridiemParse:/[ap]\.?m?\.?/i},na={},ra={};function da(e){return e?e.toLowerCase().replace("_","-"):e}function _a(e){for(var a,t,s,n,r=0;r=a&&function(e,a){for(var t=Math.min(e.length,a.length),s=0;s=a-1)break;a--}r++}return ta}function ia(a){var e;if(void 0===na[a]&&"undefined"!=typeof module&&module&&module.exports)try{e=ta._abbr,require("./locale/"+a),oa(e)}catch(e){na[a]=null}return na[a]}function oa(e,a){var t;return e&&((t=r(a)?ua(e):ma(e,a))?ta=t:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),ta._abbr}function ma(e,a){if(null===a)return delete na[e],null;var t,s=sa;if(a.abbr=e,null!=na[e])w("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=na[e]._config;else if(null!=a.parentLocale)if(null!=na[a.parentLocale])s=na[a.parentLocale]._config;else{if(null==(t=ia(a.parentLocale)))return ra[a.parentLocale]||(ra[a.parentLocale]=[]),ra[a.parentLocale].push({name:e,config:a}),null;s=t._config}return na[e]=new H(b(s,a)),ra[e]&&ra[e].forEach(function(e){ma(e.name,e.config)}),oa(e),na[e]}function ua(e){var a;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return ta;if(!_(e)){if(a=ia(e))return a;e=[e]}return _a(e)}function la(e){var a,t=e._a;return t&&-2===L(e).overflow&&(a=t[pe]<0||11He(t[fe],t[pe])?ke:t[De]<0||24Ie(t,r,d)?L(e)._overflowWeeks=!0:null!=i?L(e)._overflowWeekday=!0:(_=Re(t,s,n,r,d),e._a[fe]=_.year,e._dayOfYear=_.dayOfYear)}(e),null!=e._dayOfYear&&(r=ga(e._a[fe],s[fe]),(e._dayOfYear>Fe(r)||0===e._dayOfYear)&&(L(e)._overflowDayOfYear=!0),t=Ne(r,0,e._dayOfYear),e._a[pe]=t.getUTCMonth(),e._a[ke]=t.getUTCDate()),a=0;a<3&&null==e._a[a];++a)e._a[a]=i[a]=s[a];for(;a<7;a++)e._a[a]=i[a]=null==e._a[a]?2===a?1:0:e._a[a];24===e._a[De]&&0===e._a[Te]&&0===e._a[ge]&&0===e._a[we]&&(e._nextDay=!0,e._a[De]=0),e._d=(e._useUTC?Ne:function(e,a,t,s,n,r,d){var _;return e<100&&0<=e?(_=new Date(e+400,a,t,s,n,r,d),isFinite(_.getFullYear())&&_.setFullYear(e)):_=new Date(e,a,t,s,n,r,d),_}).apply(null,i),n=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[De]=24),e._w&&void 0!==e._w.d&&e._w.d!==n&&(L(e).weekdayMismatch=!0)}}function va(e){if(e._f!==M.ISO_8601)if(e._f!==M.RFC_2822){e._a=[],L(e).empty=!0;for(var a,t,s,n,r,d,_,i=""+e._i,o=i.length,m=0,u=E(e._f,e._locale).match(j)||[],l=0;lt.valueOf():t.valueOf()"}),yt.toJSON=function(){return this.isValid()?this.toISOString():null},yt.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},yt.unix=function(){return Math.floor(this.valueOf()/1e3)},yt.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},yt.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},yt.eraName=function(){for(var e,a=this.localeData().eras(),t=0,s=a.length;tthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},yt.isLocal=function(){return!!this.isValid()&&!this._isUTC},yt.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},yt.isUtc=Ca,yt.isUTC=Ca,yt.zoneAbbr=function(){return this._isUTC?"UTC":""},yt.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},yt.dates=t("dates accessor is deprecated. Use date instead.",lt),yt.months=t("months accessor is deprecated. Use month instead",Ae),yt.years=t("years accessor is deprecated. Use year instead",ze),yt.zone=t("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,a){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,a),this):-this.utcOffset()}),yt.isDSTShifted=t("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!r(this._isDSTShifted))return this._isDSTShifted;var e,a={};return p(a,this),(a=ba(a))._a?(e=(a._isUTC?c:Sa)(a._a),this._isDSTShifted=this.isValid()&&0>>0,s=0;sFe(e)?(r=e+1,d-Fe(e)):(r=e,d);return{year:r,dayOfYear:_}}function Ce(e,a,t){var s,n,r=Je(e.year(),a,t),d=Math.floor((e.dayOfYear()-r-1)/7)+1;return d<1?s=d+Ie(n=e.year()-1,a,t):d>Ie(e.year(),a,t)?(s=d-Ie(e.year(),a,t),n=e.year()+1):(n=e.year(),s=d),{week:s,year:n}}function Ie(e,a,t){var s=Je(e,a,t),n=Je(e+1,a,t);return(Fe(e)-s+n)/7}W("w",["ww",2],"wo","week"),W("W",["WW",2],"Wo","isoWeek"),z("week","w"),z("isoWeek","W"),C("week",5),C("isoWeek",5),le("w",ae),le("ww",ae,$),le("W",ae),le("WW",ae,$),Ye(["w","ww","W","WW"],function(e,a,t,s){a[s.substr(0,1)]=G(e)});function Ue(e,a){return e.slice(a,7).concat(e.slice(0,a))}W("d",0,"do","day"),W("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),W("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),W("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),W("e",0,0,"weekday"),W("E",0,0,"isoWeekday"),z("day","d"),z("weekday","e"),z("isoWeekday","E"),C("day",11),C("weekday",11),C("isoWeekday",11),le("d",ae),le("e",ae),le("E",ae),le("dd",function(e,a){return a.weekdaysMinRegex(e)}),le("ddd",function(e,a){return a.weekdaysShortRegex(e)}),le("dddd",function(e,a){return a.weekdaysRegex(e)}),Ye(["dd","ddd","dddd"],function(e,a,t,s){var n=t._locale.weekdaysParse(e,s,t._strict);null!=n?a.d=n:L(t).invalidWeekday=e}),Ye(["d","e","E"],function(e,a,t,s){a[s]=G(e)});var Ge="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ve="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Be="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Ke=ue,qe=ue,Ze=ue;function $e(){function e(e,a){return a.length-e.length}for(var a,t,s,n,r=[],d=[],_=[],i=[],o=0;o<7;o++)a=c([2e3,1]).day(o),t=he(this.weekdaysMin(a,"")),s=he(this.weekdaysShort(a,"")),n=he(this.weekdays(a,"")),r.push(t),d.push(s),_.push(n),i.push(t),i.push(s),i.push(n);r.sort(e),d.sort(e),_.sort(e),i.sort(e),this._weekdaysRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+_.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+r.join("|")+")","i")}function Qe(){return this.hours()%12||12}function Xe(e,a){W(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),a)})}function ea(e,a){return a._meridiemParse}W("H",["HH",2],0,"hour"),W("h",["hh",2],0,Qe),W("k",["kk",2],0,function(){return this.hours()||24}),W("hmm",0,0,function(){return""+Qe.apply(this)+H(this.minutes(),2)}),W("hmmss",0,0,function(){return""+Qe.apply(this)+H(this.minutes(),2)+H(this.seconds(),2)}),W("Hmm",0,0,function(){return""+this.hours()+H(this.minutes(),2)}),W("Hmmss",0,0,function(){return""+this.hours()+H(this.minutes(),2)+H(this.seconds(),2)}),Xe("a",!0),Xe("A",!1),z("hour","h"),C("hour",13),le("a",ea),le("A",ea),le("H",ae),le("h",ae),le("k",ae),le("HH",ae,$),le("hh",ae,$),le("kk",ae,$),le("hmm",te),le("hmmss",se),le("Hmm",te),le("Hmmss",se),Le(["H","HH"],De),Le(["k","kk"],function(e,a,t){var s=G(e);a[De]=24===s?0:s}),Le(["a","A"],function(e,a,t){t._isPm=t._locale.isPM(e),t._meridiem=e}),Le(["h","hh"],function(e,a,t){a[De]=G(e),L(t).bigHour=!0}),Le("hmm",function(e,a,t){var s=e.length-2;a[De]=G(e.substr(0,s)),a[Te]=G(e.substr(s)),L(t).bigHour=!0}),Le("hmmss",function(e,a,t){var s=e.length-4,n=e.length-2;a[De]=G(e.substr(0,s)),a[Te]=G(e.substr(s,2)),a[ge]=G(e.substr(n)),L(t).bigHour=!0}),Le("Hmm",function(e,a,t){var s=e.length-2;a[De]=G(e.substr(0,s)),a[Te]=G(e.substr(s))}),Le("Hmmss",function(e,a,t){var s=e.length-4,n=e.length-2;a[De]=G(e.substr(0,s)),a[Te]=G(e.substr(s,2)),a[ge]=G(e.substr(n))});var aa=V("Hours",!0);var ta,sa={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:He,monthsShort:je,week:{dow:0,doy:6},weekdays:Ge,weekdaysMin:Be,weekdaysShort:Ve,meridiemParse:/[ap]\.?m?\.?/i},na={},ra={};function da(e){return e?e.toLowerCase().replace("_","-"):e}function _a(e){for(var a,t,s,n,r=0;r=a&&function(e,a){for(var t=Math.min(e.length,a.length),s=0;s=a-1)break;a--}r++}return ta}function ia(a){var e;if(void 0===na[a]&&"undefined"!=typeof module&&module&&module.exports)try{e=ta._abbr,require("./locale/"+a),oa(e)}catch(e){na[a]=null}return na[a]}function oa(e,a){var t;return e&&((t=r(a)?ua(e):ma(e,a))?ta=t:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),ta._abbr}function ma(e,a){if(null===a)return delete na[e],null;var t,s=sa;if(a.abbr=e,null!=na[e])w("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=na[e]._config;else if(null!=a.parentLocale)if(null!=na[a.parentLocale])s=na[a.parentLocale]._config;else{if(null==(t=ia(a.parentLocale)))return ra[a.parentLocale]||(ra[a.parentLocale]=[]),ra[a.parentLocale].push({name:e,config:a}),null;s=t._config}return na[e]=new S(b(s,a)),ra[e]&&ra[e].forEach(function(e){ma(e.name,e.config)}),oa(e),na[e]}function ua(e){var a;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return ta;if(!_(e)){if(a=ia(e))return a;e=[e]}return _a(e)}function la(e){var a,t=e._a;return t&&-2===L(e).overflow&&(a=t[pe]<0||11Se(t[fe],t[pe])?ke:t[De]<0||24Ie(t,r,d)?L(e)._overflowWeeks=!0:null!=i?L(e)._overflowWeekday=!0:(_=Re(t,s,n,r,d),e._a[fe]=_.year,e._dayOfYear=_.dayOfYear)}(e),null!=e._dayOfYear&&(r=ga(e._a[fe],s[fe]),(e._dayOfYear>Fe(r)||0===e._dayOfYear)&&(L(e)._overflowDayOfYear=!0),t=Ne(r,0,e._dayOfYear),e._a[pe]=t.getUTCMonth(),e._a[ke]=t.getUTCDate()),a=0;a<3&&null==e._a[a];++a)e._a[a]=i[a]=s[a];for(;a<7;a++)e._a[a]=i[a]=null==e._a[a]?2===a?1:0:e._a[a];24===e._a[De]&&0===e._a[Te]&&0===e._a[ge]&&0===e._a[we]&&(e._nextDay=!0,e._a[De]=0),e._d=(e._useUTC?Ne:function(e,a,t,s,n,r,d){var _;return e<100&&0<=e?(_=new Date(e+400,a,t,s,n,r,d),isFinite(_.getFullYear())&&_.setFullYear(e)):_=new Date(e,a,t,s,n,r,d),_}).apply(null,i),n=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[De]=24),e._w&&void 0!==e._w.d&&e._w.d!==n&&(L(e).weekdayMismatch=!0)}}function va(e){if(e._f!==M.ISO_8601)if(e._f!==M.RFC_2822){e._a=[],L(e).empty=!0;for(var a,t,s,n,r,d,_,i=""+e._i,o=i.length,m=0,u=E(e._f,e._locale).match(j)||[],l=0;lt.valueOf():t.valueOf()"}),yt.toJSON=function(){return this.isValid()?this.toISOString():null},yt.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},yt.unix=function(){return Math.floor(this.valueOf()/1e3)},yt.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},yt.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},yt.eraName=function(){for(var e,a=this.localeData().eras(),t=0,s=a.length;tthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},yt.isLocal=function(){return!!this.isValid()&&!this._isUTC},yt.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},yt.isUtc=Ca,yt.isUTC=Ca,yt.zoneAbbr=function(){return this._isUTC?"UTC":""},yt.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},yt.dates=t("dates accessor is deprecated. Use date instead.",lt),yt.months=t("months accessor is deprecated. Use month instead",Ae),yt.years=t("years accessor is deprecated. Use year instead",ze),yt.zone=t("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,a){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,a),this):-this.utcOffset()}),yt.isDSTShifted=t("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!r(this._isDSTShifted))return this._isDSTShifted;var e,a={};return p(a,this),(a=ba(a))._a?(e=(a._isUTC?c:Ha)(a._a),this._isDSTShifted=this.isValid()&&0>>0,s=0;sFe(e)?(r=e+1,a-Fe(e)):(r=e,a);return{year:r,dayOfYear:o}}function Ae(e,t,n){var s,i,r=Ge(e.year(),t,n),a=Math.floor((e.dayOfYear()-r-1)/7)+1;return a<1?s=a+je(i=e.year()-1,t,n):a>je(e.year(),t,n)?(s=a-je(e.year(),t,n),i=e.year()+1):(i=e.year(),s=a),{week:s,year:i}}function je(e,t,n){var s=Ge(e,t,n),i=Ge(e+1,t,n);return(Fe(e)-s+i)/7}C("w",["ww",2],"wo","week"),C("W",["WW",2],"Wo","isoWeek"),L("week","w"),L("isoWeek","W"),A("week",5),A("isoWeek",5),ce("w",te),ce("ww",te,Q),ce("W",te),ce("WW",te,Q),ge(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=Z(e)});function Ie(e,t){return e.slice(t,7).concat(e.slice(0,t))}C("d",0,"do","day"),C("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),C("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),C("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),C("e",0,0,"weekday"),C("E",0,0,"isoWeekday"),L("day","d"),L("weekday","e"),L("isoWeekday","E"),A("day",11),A("weekday",11),A("isoWeekday",11),ce("d",te),ce("e",te),ce("E",te),ce("dd",function(e,t){return t.weekdaysMinRegex(e)}),ce("ddd",function(e,t){return t.weekdaysShortRegex(e)}),ce("dddd",function(e,t){return t.weekdaysRegex(e)}),ge(["dd","ddd","dddd"],function(e,t,n,s){var i=n._locale.weekdaysParse(e,s,n._strict);null!=i?t.d=i:y(n).invalidWeekday=e}),ge(["d","e","E"],function(e,t,n,s){t[s]=Z(e)});var Ze="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),ze="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),$e="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),qe=de,Be=de,Je=de;function Qe(){function e(e,t){return t.length-e.length}for(var t,n,s,i,r=[],a=[],o=[],u=[],l=0;l<7;l++)t=_([2e3,1]).day(l),n=me(this.weekdaysMin(t,"")),s=me(this.weekdaysShort(t,"")),i=me(this.weekdays(t,"")),r.push(n),a.push(s),o.push(i),u.push(n),u.push(s),u.push(i);r.sort(e),a.sort(e),o.sort(e),u.sort(e),this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+r.join("|")+")","i")}function Xe(){return this.hours()%12||12}function Ke(e,t){C(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function et(e,t){return t._meridiemParse}C("H",["HH",2],0,"hour"),C("h",["hh",2],0,Xe),C("k",["kk",2],0,function(){return this.hours()||24}),C("hmm",0,0,function(){return""+Xe.apply(this)+T(this.minutes(),2)}),C("hmmss",0,0,function(){return""+Xe.apply(this)+T(this.minutes(),2)+T(this.seconds(),2)}),C("Hmm",0,0,function(){return""+this.hours()+T(this.minutes(),2)}),C("Hmmss",0,0,function(){return""+this.hours()+T(this.minutes(),2)+T(this.seconds(),2)}),Ke("a",!0),Ke("A",!1),L("hour","h"),A("hour",13),ce("a",et),ce("A",et),ce("H",te),ce("h",te),ce("k",te),ce("HH",te,Q),ce("hh",te,Q),ce("kk",te,Q),ce("hmm",ne),ce("hmmss",se),ce("Hmm",ne),ce("Hmmss",se),ye(["H","HH"],Me),ye(["k","kk"],function(e,t,n){var s=Z(e);t[Me]=24===s?0:s}),ye(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),ye(["h","hh"],function(e,t,n){t[Me]=Z(e),y(n).bigHour=!0}),ye("hmm",function(e,t,n){var s=e.length-2;t[Me]=Z(e.substr(0,s)),t[De]=Z(e.substr(s)),y(n).bigHour=!0}),ye("hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[Me]=Z(e.substr(0,s)),t[De]=Z(e.substr(s,2)),t[Se]=Z(e.substr(i)),y(n).bigHour=!0}),ye("Hmm",function(e,t,n){var s=e.length-2;t[Me]=Z(e.substr(0,s)),t[De]=Z(e.substr(s))}),ye("Hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[Me]=Z(e.substr(0,s)),t[De]=Z(e.substr(s,2)),t[Se]=Z(e.substr(i))});var tt=z("Hours",!0);var nt,st={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Te,monthsShort:Ne,week:{dow:0,doy:6},weekdays:Ze,weekdaysMin:$e,weekdaysShort:ze,meridiemParse:/[ap]\.?m?\.?/i},it={},rt={};function at(e){return e?e.toLowerCase().replace("_","-"):e}function ot(e){for(var t,n,s,i,r=0;r=t&&function(e,t){for(var n=Math.min(e.length,t.length),s=0;s=t-1)break;t--}r++}return nt}function ut(t){var e;if(void 0===it[t]&&"undefined"!=typeof module&&module&&module.exports)try{e=nt._abbr,require("./locale/"+t),lt(e)}catch(e){it[t]=null}return it[t]}function lt(e,t){var n;return e&&((n=r(t)?dt(e):ht(e,t))?nt=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),nt._abbr}function ht(e,t){if(null===t)return delete it[e],null;var n,s=st;if(t.abbr=e,null!=it[e])Y("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=it[e]._config;else if(null!=t.parentLocale)if(null!=it[t.parentLocale])s=it[t.parentLocale]._config;else{if(null==(n=ut(t.parentLocale)))return rt[t.parentLocale]||(rt[t.parentLocale]=[]),rt[t.parentLocale].push({name:e,config:t}),null;s=n._config}return it[e]=new x(b(s,t)),rt[e]&&rt[e].forEach(function(e){ht(e.name,e.config)}),lt(e),it[e]}function dt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return nt;if(!o(e)){if(t=ut(e))return t;e=[e]}return ot(e)}function ct(e){var t,n=e._a;return n&&-2===y(e).overflow&&(t=n[ve]<0||11xe(n[pe],n[ve])?ke:n[Me]<0||24je(n,r,a)?y(e)._overflowWeeks=!0:null!=u?y(e)._overflowWeekday=!0:(o=Ee(n,s,i,r,a),e._a[pe]=o.year,e._dayOfYear=o.dayOfYear)}(e),null!=e._dayOfYear&&(r=St(e._a[pe],s[pe]),(e._dayOfYear>Fe(r)||0===e._dayOfYear)&&(y(e)._overflowDayOfYear=!0),n=Ve(r,0,e._dayOfYear),e._a[ve]=n.getUTCMonth(),e._a[ke]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=u[t]=s[t];for(;t<7;t++)e._a[t]=u[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[Me]&&0===e._a[De]&&0===e._a[Se]&&0===e._a[Ye]&&(e._nextDay=!0,e._a[Me]=0),e._d=(e._useUTC?Ve:function(e,t,n,s,i,r,a){var o;return e<100&&0<=e?(o=new Date(e+400,t,n,s,i,r,a),isFinite(o.getFullYear())&&o.setFullYear(e)):o=new Date(e,t,n,s,i,r,a),o}).apply(null,u),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Me]=24),e._w&&void 0!==e._w.d&&e._w.d!==i&&(y(e).weekdayMismatch=!0)}}function Ot(e){if(e._f!==f.ISO_8601)if(e._f!==f.RFC_2822){e._a=[],y(e).empty=!0;for(var t,n,s,i,r,a,o,u=""+e._i,l=u.length,h=0,d=H(e._f,e._locale).match(N)||[],c=0;cn.valueOf():n.valueOf()"}),pn.toJSON=function(){return this.isValid()?this.toISOString():null},pn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},pn.unix=function(){return Math.floor(this.valueOf()/1e3)},pn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},pn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},pn.eraName=function(){for(var e,t=this.localeData().eras(),n=0,s=t.length;nthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},pn.isLocal=function(){return!!this.isValid()&&!this._isUTC},pn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},pn.isUtc=At,pn.isUTC=At,pn.zoneAbbr=function(){return this._isUTC?"UTC":""},pn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},pn.dates=n("dates accessor is deprecated. Use date instead.",fn),pn.months=n("months accessor is deprecated. Use month instead",Ue),pn.years=n("years accessor is deprecated. Use year instead",Le),pn.zone=n("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),pn.isDSTShifted=n("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!r(this._isDSTShifted))return this._isDSTShifted;var e,t={};return v(t,this),(t=bt(t))._a?(e=(t._isUTC?_:Tt)(t._a),this._isDSTShifted=this.isValid()&&0>>0,s=0;sFe(e)?(r=e+1,a-Fe(e)):(r=e,a);return{year:r,dayOfYear:o}}function Ae(e,t,n){var s,i,r=Ge(e.year(),t,n),a=Math.floor((e.dayOfYear()-r-1)/7)+1;return a<1?s=a+je(i=e.year()-1,t,n):a>je(e.year(),t,n)?(s=a-je(e.year(),t,n),i=e.year()+1):(i=e.year(),s=a),{week:s,year:i}}function je(e,t,n){var s=Ge(e,t,n),i=Ge(e+1,t,n);return(Fe(e)-s+i)/7}C("w",["ww",2],"wo","week"),C("W",["WW",2],"Wo","isoWeek"),L("week","w"),L("isoWeek","W"),A("week",5),A("isoWeek",5),ce("w",te),ce("ww",te,Q),ce("W",te),ce("WW",te,Q),ge(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=Z(e)});function Ie(e,t){return e.slice(t,7).concat(e.slice(0,t))}C("d",0,"do","day"),C("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),C("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),C("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),C("e",0,0,"weekday"),C("E",0,0,"isoWeekday"),L("day","d"),L("weekday","e"),L("isoWeekday","E"),A("day",11),A("weekday",11),A("isoWeekday",11),ce("d",te),ce("e",te),ce("E",te),ce("dd",function(e,t){return t.weekdaysMinRegex(e)}),ce("ddd",function(e,t){return t.weekdaysShortRegex(e)}),ce("dddd",function(e,t){return t.weekdaysRegex(e)}),ge(["dd","ddd","dddd"],function(e,t,n,s){var i=n._locale.weekdaysParse(e,s,n._strict);null!=i?t.d=i:y(n).invalidWeekday=e}),ge(["d","e","E"],function(e,t,n,s){t[s]=Z(e)});var Ze="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),ze="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),$e="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),qe=de,Be=de,Je=de;function Qe(){function e(e,t){return t.length-e.length}for(var t,n,s,i,r=[],a=[],o=[],u=[],l=0;l<7;l++)t=_([2e3,1]).day(l),n=me(this.weekdaysMin(t,"")),s=me(this.weekdaysShort(t,"")),i=me(this.weekdays(t,"")),r.push(n),a.push(s),o.push(i),u.push(n),u.push(s),u.push(i);r.sort(e),a.sort(e),o.sort(e),u.sort(e),this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+r.join("|")+")","i")}function Xe(){return this.hours()%12||12}function Ke(e,t){C(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function et(e,t){return t._meridiemParse}C("H",["HH",2],0,"hour"),C("h",["hh",2],0,Xe),C("k",["kk",2],0,function(){return this.hours()||24}),C("hmm",0,0,function(){return""+Xe.apply(this)+T(this.minutes(),2)}),C("hmmss",0,0,function(){return""+Xe.apply(this)+T(this.minutes(),2)+T(this.seconds(),2)}),C("Hmm",0,0,function(){return""+this.hours()+T(this.minutes(),2)}),C("Hmmss",0,0,function(){return""+this.hours()+T(this.minutes(),2)+T(this.seconds(),2)}),Ke("a",!0),Ke("A",!1),L("hour","h"),A("hour",13),ce("a",et),ce("A",et),ce("H",te),ce("h",te),ce("k",te),ce("HH",te,Q),ce("hh",te,Q),ce("kk",te,Q),ce("hmm",ne),ce("hmmss",se),ce("Hmm",ne),ce("Hmmss",se),ye(["H","HH"],Me),ye(["k","kk"],function(e,t,n){var s=Z(e);t[Me]=24===s?0:s}),ye(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),ye(["h","hh"],function(e,t,n){t[Me]=Z(e),y(n).bigHour=!0}),ye("hmm",function(e,t,n){var s=e.length-2;t[Me]=Z(e.substr(0,s)),t[De]=Z(e.substr(s)),y(n).bigHour=!0}),ye("hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[Me]=Z(e.substr(0,s)),t[De]=Z(e.substr(s,2)),t[Se]=Z(e.substr(i)),y(n).bigHour=!0}),ye("Hmm",function(e,t,n){var s=e.length-2;t[Me]=Z(e.substr(0,s)),t[De]=Z(e.substr(s))}),ye("Hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[Me]=Z(e.substr(0,s)),t[De]=Z(e.substr(s,2)),t[Se]=Z(e.substr(i))});var tt=z("Hours",!0);var nt,st={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Te,monthsShort:Ne,week:{dow:0,doy:6},weekdays:Ze,weekdaysMin:$e,weekdaysShort:ze,meridiemParse:/[ap]\.?m?\.?/i},it={},rt={};function at(e){return e?e.toLowerCase().replace("_","-"):e}function ot(e){for(var t,n,s,i,r=0;r=t&&function(e,t){for(var n=Math.min(e.length,t.length),s=0;s=t-1)break;t--}r++}return nt}function ut(t){var e;if(void 0===it[t]&&"undefined"!=typeof module&&module&&module.exports)try{e=nt._abbr,require("./locale/"+t),lt(e)}catch(e){it[t]=null}return it[t]}function lt(e,t){var n;return e&&((n=r(t)?dt(e):ht(e,t))?nt=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),nt._abbr}function ht(e,t){if(null===t)return delete it[e],null;var n,s=st;if(t.abbr=e,null!=it[e])Y("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=it[e]._config;else if(null!=t.parentLocale)if(null!=it[t.parentLocale])s=it[t.parentLocale]._config;else{if(null==(n=ut(t.parentLocale)))return rt[t.parentLocale]||(rt[t.parentLocale]=[]),rt[t.parentLocale].push({name:e,config:t}),null;s=n._config}return it[e]=new x(b(s,t)),rt[e]&&rt[e].forEach(function(e){ht(e.name,e.config)}),lt(e),it[e]}function dt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return nt;if(!o(e)){if(t=ut(e))return t;e=[e]}return ot(e)}function ct(e){var t,n=e._a;return n&&-2===y(e).overflow&&(t=n[ve]<0||11xe(n[pe],n[ve])?ke:n[Me]<0||24je(n,r,a)?y(e)._overflowWeeks=!0:null!=u?y(e)._overflowWeekday=!0:(o=Ee(n,s,i,r,a),e._a[pe]=o.year,e._dayOfYear=o.dayOfYear)}(e),null!=e._dayOfYear&&(r=St(e._a[pe],s[pe]),(e._dayOfYear>Fe(r)||0===e._dayOfYear)&&(y(e)._overflowDayOfYear=!0),n=Ve(r,0,e._dayOfYear),e._a[ve]=n.getUTCMonth(),e._a[ke]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=u[t]=s[t];for(;t<7;t++)e._a[t]=u[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[Me]&&0===e._a[De]&&0===e._a[Se]&&0===e._a[Ye]&&(e._nextDay=!0,e._a[Me]=0),e._d=(e._useUTC?Ve:function(e,t,n,s,i,r,a){var o;return e<100&&0<=e?(o=new Date(e+400,t,n,s,i,r,a),isFinite(o.getFullYear())&&o.setFullYear(e)):o=new Date(e,t,n,s,i,r,a),o}).apply(null,u),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Me]=24),e._w&&void 0!==e._w.d&&e._w.d!==i&&(y(e).weekdayMismatch=!0)}}function Ot(e){if(e._f!==f.ISO_8601)if(e._f!==f.RFC_2822){e._a=[],y(e).empty=!0;for(var t,n,s,i,r,a,o,u=""+e._i,l=u.length,h=0,d=H(e._f,e._locale).match(N)||[],c=0;cn.valueOf():n.valueOf()"}),pn.toJSON=function(){return this.isValid()?this.toISOString():null},pn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},pn.unix=function(){return Math.floor(this.valueOf()/1e3)},pn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},pn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},pn.eraName=function(){for(var e,t=this.localeData().eras(),n=0,s=t.length;nthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},pn.isLocal=function(){return!!this.isValid()&&!this._isUTC},pn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},pn.isUtc=At,pn.isUTC=At,pn.zoneAbbr=function(){return this._isUTC?"UTC":""},pn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},pn.dates=n("dates accessor is deprecated. Use date instead.",fn),pn.months=n("months accessor is deprecated. Use month instead",Ue),pn.years=n("years accessor is deprecated. Use year instead",Le),pn.zone=n("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),pn.isDSTShifted=n("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!r(this._isDSTShifted))return this._isDSTShifted;var e,t={};return v(t,this),(t=bt(t))._a?(e=(t._isUTC?_:Tt)(t._a),this._isDSTShifted=this.isValid()&&0 ' + a[i][1]); + } + }); + + test('format ordinal', function (assert) { + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1r', '1r'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2n', '2n'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3r', '3r'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4t', '4t'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5è', '5è'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6è', '6è'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7è', '7è'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8è', '8è'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9è', '9è'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10è', '10è'); + + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11è', '11è'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12è', '12è'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13è', '13è'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14è', '14è'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15è', '15è'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16è', '16è'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17è', '17è'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18è', '18è'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19è', '19è'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20è', '20è'); + + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21è', '21è'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22è', '22è'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23è', '23è'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24è', '24è'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25è', '25è'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26è', '26è'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27è', '27è'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28è', '28è'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29è', '29è'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30è', '30è'); + + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31è', '31è'); + }); + + test('format month', function (assert) { + var expected = 'gener gen._febrer febr._març març_abril abr._maig maig_juny juny_juliol jul._agost ag._setembre set._octubre oct._novembre nov._desembre des.'.split( + '_' + ), + i; + for (i = 0; i < expected.length; i++) { + assert.equal( + moment([2011, i, 1]).format('MMMM MMM'), + expected[i], + expected[i] + ); + } + }); + + test('format week', function (assert) { + var expected = 'diumenge dg. dg_dilluns dl. dl_dimarts dt. dt_dimecres dc. dc_dijous dj. dj_divendres dv. dv_dissabte ds. ds'.split( + '_' + ), + i; + for (i = 0; i < expected.length; i++) { + assert.equal( + moment([2011, 0, 2 + i]).format('dddd ddd dd'), + expected[i], + expected[i] + ); + } + }); + + test('from', function (assert) { + var start = moment([2007, 1, 28]); + assert.equal( + start.from(moment([2007, 1, 28]).add({ s: 44 }), true), + 'uns segons', + '44 seconds = a few seconds' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ s: 45 }), true), + 'un minut', + '45 seconds = a minute' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ s: 89 }), true), + 'un minut', + '89 seconds = a minute' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ s: 90 }), true), + '2 minuts', + '90 seconds = 2 minutes' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ m: 44 }), true), + '44 minuts', + '44 minutes = 44 minutes' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ m: 45 }), true), + 'una hora', + '45 minutes = an hour' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ m: 89 }), true), + 'una hora', + '89 minutes = an hour' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ m: 90 }), true), + '2 hores', + '90 minutes = 2 hours' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ h: 5 }), true), + '5 hores', + '5 hours = 5 hours' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ h: 21 }), true), + '21 hores', + '21 hours = 21 hours' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ h: 22 }), true), + 'un dia', + '22 hours = a day' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ h: 35 }), true), + 'un dia', + '35 hours = a day' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ h: 36 }), true), + '2 dies', + '36 hours = 2 days' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ d: 1 }), true), + 'un dia', + '1 day = a day' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ d: 5 }), true), + '5 dies', + '5 days = 5 days' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ d: 25 }), true), + '25 dies', + '25 days = 25 days' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ d: 26 }), true), + 'un mes', + '26 days = a month' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ d: 30 }), true), + 'un mes', + '30 days = a month' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ d: 43 }), true), + 'un mes', + '43 days = a month' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ d: 46 }), true), + '2 mesos', + '46 days = 2 months' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ d: 74 }), true), + '2 mesos', + '75 days = 2 months' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ d: 76 }), true), + '3 mesos', + '76 days = 3 months' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ M: 1 }), true), + 'un mes', + '1 month = a month' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ M: 5 }), true), + '5 mesos', + '5 months = 5 months' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ d: 345 }), true), + 'un any', + '345 days = a year' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ d: 548 }), true), + '2 anys', + '548 days = 2 years' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ y: 1 }), true), + 'un any', + '1 year = a year' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ y: 5 }), true), + '5 anys', + '5 years = 5 years' + ); + }); + + test('suffix', function (assert) { + assert.equal(moment(30000).from(0), "d'aquí uns segons", 'prefix'); + assert.equal(moment(0).from(30000), 'fa uns segons', 'suffix'); + }); + + test('now from now', function (assert) { + assert.equal( + moment().fromNow(), + 'fa uns segons', + 'now from now should display as in the past' + ); + }); + + test('fromNow', function (assert) { + assert.equal( + moment().add({ s: 30 }).fromNow(), + "d'aquí uns segons", + "d'aquí uns segons" + ); + assert.equal( + moment().add({ d: 5 }).fromNow(), + "d'aquí 5 dies", + "d'aquí 5 dies" + ); + }); + + test('calendar day', function (assert) { + var a = moment().hours(12).minutes(0).seconds(0); + + assert.equal( + moment(a).calendar(), + 'avui a les 12:00', + 'today at the same time' + ); + assert.equal( + moment(a).add({ m: 25 }).calendar(), + 'avui a les 12:25', + 'Now plus 25 min' + ); + assert.equal( + moment(a).add({ h: 1 }).calendar(), + 'avui a les 13:00', + 'Now plus 1 hour' + ); + assert.equal( + moment(a).add({ d: 1 }).calendar(), + 'demà a les 12:00', + 'tomorrow at the same time' + ); + assert.equal( + moment(a).add({ d: 1, h: -1 }).calendar(), + 'demà a les 11:00', + 'tomorrow minus 1 hour' + ); + assert.equal( + moment(a).subtract({ h: 1 }).calendar(), + 'avui a les 11:00', + 'Now minus 1 hour' + ); + assert.equal( + moment(a).subtract({ d: 1 }).calendar(), + 'ahir a les 12:00', + 'yesterday at the same time' + ); + }); + + test('calendar next week', function (assert) { + var i, m; + for (i = 2; i < 7; i++) { + m = moment().add({ d: i }); + assert.equal( + m.calendar(), + m.format('dddd [a ' + (m.hours() !== 1 ? 'les' : 'la') + '] LT'), + 'Today + ' + i + ' days current time' + ); + m.hours(0).minutes(0).seconds(0).milliseconds(0); + assert.equal( + m.calendar(), + m.format('dddd [a ' + (m.hours() !== 1 ? 'les' : 'la') + '] LT'), + 'Today + ' + i + ' days beginning of day' + ); + m.hours(23).minutes(59).seconds(59).milliseconds(999); + assert.equal( + m.calendar(), + m.format('dddd [a ' + (m.hours() !== 1 ? 'les' : 'la') + '] LT'), + 'Today + ' + i + ' days end of day' + ); + } + }); + + test('calendar last week', function (assert) { + var i, m; + for (i = 2; i < 7; i++) { + m = moment().subtract({ d: i }); + assert.equal( + m.calendar(), + m.format( + '[el] dddd [passat a ' + + (m.hours() !== 1 ? 'les' : 'la') + + '] LT' + ), + 'Today - ' + i + ' days current time' + ); + m.hours(0).minutes(0).seconds(0).milliseconds(0); + assert.equal( + m.calendar(), + m.format( + '[el] dddd [passat a ' + + (m.hours() !== 1 ? 'les' : 'la') + + '] LT' + ), + 'Today - ' + i + ' days beginning of day' + ); + m.hours(23).minutes(59).seconds(59).milliseconds(999); + assert.equal( + m.calendar(), + m.format( + '[el] dddd [passat a ' + + (m.hours() !== 1 ? 'les' : 'la') + + '] LT' + ), 'Today - ' + i + ' days end of day' ); } @@ -15378,20 +16244,1049 @@ defineCommonLocaleTests(name); } - localeModule('cs'); + localeModule('cs'); + + test('parse', function (assert) { + var tests = 'leden led ledna_únor úno února_březen bře března_duben dub dubna_květen kvě května_červen čvn června_červenec čvc července_srpen srp srpna_září zář září_říjen říj října_listopad lis listopadu_prosinec pro prosince'.split( + '_' + ), + i; + function equalTest(input, mmm, monthIndex) { + assert.equal( + moment(input, mmm).month(), + monthIndex, + input + ' ' + mmm + ' should be month ' + (monthIndex + 1) + ); + } + function equalTestStrict(input, mmm, monthIndex) { + assert.equal( + moment(input, mmm, true).month(), + monthIndex, + input + ' ' + mmm + ' should be strict month ' + (monthIndex + 1) + ); + } + for (i = 0; i < 12; i++) { + tests[i] = tests[i].split(' '); + equalTest(tests[i][0], 'MMM', i); + equalTest(tests[i][1], 'MMM', i); + equalTest(tests[i][2], 'MMM', i); + equalTest(tests[i][0], 'MMMM', i); + equalTest(tests[i][1], 'MMMM', i); + equalTest(tests[i][2], 'MMMM', i); + equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i); + equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i); + equalTest(tests[i][2].toLocaleLowerCase(), 'MMMM', i); + equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i); + equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i); + equalTest(tests[i][2].toLocaleUpperCase(), 'MMMM', i); + + equalTestStrict(tests[i][1], 'MMM', i); + equalTestStrict(tests[i][0], 'MMMM', i); + equalTestStrict(tests[i][2], 'MMMM', i); + equalTestStrict(tests[i][1].toLocaleLowerCase(), 'MMM', i); + equalTestStrict(tests[i][1].toLocaleUpperCase(), 'MMM', i); + equalTestStrict(tests[i][0].toLocaleLowerCase(), 'MMMM', i); + equalTestStrict(tests[i][0].toLocaleUpperCase(), 'MMMM', i); + equalTestStrict(tests[i][2].toLocaleLowerCase(), 'MMMM', i); + equalTestStrict(tests[i][2].toLocaleUpperCase(), 'MMMM', i); + } + }); + + test('format', function (assert) { + var a = [ + ['dddd, MMMM Do YYYY, h:mm:ss', 'neděle, únor 14. 2010, 3:25:50'], + ['ddd, h', 'ne, 3'], + ['M Mo MM MMMM MMM', '2 2. 02 únor úno'], + ['YYYY YY', '2010 10'], + ['D Do DD', '14 14. 14'], + ['d do dddd ddd dd', '0 0. neděle ne ne'], + ['DDD DDDo DDDD', '45 45. 045'], + ['w wo ww', '6 6. 06'], + ['h hh', '3 03'], + ['H HH', '15 15'], + ['m mm', '25 25'], + ['s ss', '50 50'], + ['a A', 'pm PM'], + ['DDDo [den v roce]', '45. den v roce'], + ['LTS', '15:25:50'], + ['L', '14.02.2010'], + ['LL', '14. únor 2010'], + ['LLL', '14. únor 2010 15:25'], + ['LLLL', 'neděle 14. únor 2010 15:25'], + ['l', '14. 2. 2010'], + ['ll', '14. úno 2010'], + ['lll', '14. úno 2010 15:25'], + ['llll', 'ne 14. úno 2010 15:25'], + ], + b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), + i; + for (i = 0; i < a.length; i++) { + assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]); + } + }); + + test('format ordinal', function (assert) { + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.'); + + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.'); + + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.'); + + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); + }); + + test('format month', function (assert) { + var expected = 'leden led_únor úno_březen bře_duben dub_květen kvě_červen čvn_červenec čvc_srpen srp_září zář_říjen říj_listopad lis_prosinec pro'.split( + '_' + ), + i; + for (i = 0; i < expected.length; i++) { + assert.equal( + moment([2011, i, 1]).format('MMMM MMM'), + expected[i], + expected[i] + ); + } + }); + + test('format week', function (assert) { + var expected = 'neděle ne ne_pondělí po po_úterý út út_středa st st_čtvrtek čt čt_pátek pá pá_sobota so so'.split( + '_' + ), + i; + for (i = 0; i < expected.length; i++) { + assert.equal( + moment([2011, 0, 2 + i]).format('dddd ddd dd'), + expected[i], + expected[i] + ); + } + }); + + test('from', function (assert) { + var start = moment([2007, 1, 28]); + assert.equal( + start.from(moment([2007, 1, 28]).add({ s: 44 }), true), + 'pár sekund', + '44 seconds = a few seconds' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ s: 45 }), true), + 'minuta', + '45 seconds = a minute' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ s: 89 }), true), + 'minuta', + '89 seconds = a minute' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ s: 90 }), true), + '2 minuty', + '90 seconds = 2 minutes' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ m: 44 }), true), + '44 minut', + '44 minutes = 44 minutes' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ m: 45 }), true), + 'hodina', + '45 minutes = an hour' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ m: 89 }), true), + 'hodina', + '89 minutes = an hour' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ m: 90 }), true), + '2 hodiny', + '90 minutes = 2 hours' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ h: 5 }), true), + '5 hodin', + '5 hours = 5 hours' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ h: 21 }), true), + '21 hodin', + '21 hours = 21 hours' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ h: 22 }), true), + 'den', + '22 hours = a day' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ h: 35 }), true), + 'den', + '35 hours = a day' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ h: 36 }), true), + '2 dny', + '36 hours = 2 days' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ d: 1 }), true), + 'den', + '1 day = a day' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ d: 5 }), true), + '5 dní', + '5 days = 5 days' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ d: 25 }), true), + '25 dní', + '25 days = 25 days' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ d: 26 }), true), + 'měsíc', + '26 days = a month' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ d: 30 }), true), + 'měsíc', + '30 days = a month' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ d: 43 }), true), + 'měsíc', + '43 days = a month' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ d: 46 }), true), + '2 měsíce', + '46 days = 2 months' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ d: 74 }), true), + '2 měsíce', + '75 days = 2 months' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ d: 76 }), true), + '3 měsíce', + '76 days = 3 months' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ M: 1 }), true), + 'měsíc', + '1 month = a month' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ M: 5 }), true), + '5 měsíců', + '5 months = 5 months' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ d: 345 }), true), + 'rok', + '345 days = a year' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ d: 548 }), true), + '2 roky', + '548 days = 2 years' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ y: 1 }), true), + 'rok', + '1 year = a year' + ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ y: 5 }), true), + '5 let', + '5 years = 5 years' + ); + }); + + test('suffix', function (assert) { + assert.equal(moment(30000).from(0), 'za pár sekund', 'prefix'); + assert.equal(moment(0).from(30000), 'před pár sekundami', 'suffix'); + }); + + test('now from now', function (assert) { + assert.equal( + moment().fromNow(), + 'před pár sekundami', + 'now from now should display as in the past' + ); + }); + + test('fromNow (future)', function (assert) { + assert.equal( + moment().add({ s: 30 }).fromNow(), + 'za pár sekund', + 'in a few seconds' + ); + assert.equal(moment().add({ m: 1 }).fromNow(), 'za minutu', 'in a minute'); + assert.equal( + moment().add({ m: 3 }).fromNow(), + 'za 3 minuty', + 'in 3 minutes' + ); + assert.equal( + moment().add({ m: 10 }).fromNow(), + 'za 10 minut', + 'in 10 minutes' + ); + assert.equal(moment().add({ h: 1 }).fromNow(), 'za hodinu', 'in an hour'); + assert.equal(moment().add({ h: 3 }).fromNow(), 'za 3 hodiny', 'in 3 hours'); + assert.equal( + moment().add({ h: 10 }).fromNow(), + 'za 10 hodin', + 'in 10 hours' + ); + assert.equal(moment().add({ d: 1 }).fromNow(), 'za den', 'in a day'); + assert.equal(moment().add({ d: 3 }).fromNow(), 'za 3 dny', 'in 3 days'); + assert.equal(moment().add({ d: 10 }).fromNow(), 'za 10 dní', 'in 10 days'); + assert.equal(moment().add({ M: 1 }).fromNow(), 'za měsíc', 'in a month'); + assert.equal( + moment().add({ M: 3 }).fromNow(), + 'za 3 měsíce', + 'in 3 months' + ); + assert.equal( + moment().add({ M: 10 }).fromNow(), + 'za 10 měsíců', + 'in 10 months' + ); + assert.equal(moment().add({ y: 1 }).fromNow(), 'za rok', 'in a year'); + assert.equal(moment().add({ y: 3 }).fromNow(), 'za 3 roky', 'in 3 years'); + assert.equal(moment().add({ y: 10 }).fromNow(), 'za 10 let', 'in 10 years'); + }); + + test('fromNow (past)', function (assert) { + assert.equal( + moment().subtract({ s: 30 }).fromNow(), + 'před pár sekundami', + 'a few seconds ago' + ); + assert.equal( + moment().subtract({ m: 1 }).fromNow(), + 'před minutou', + 'a minute ago' + ); + assert.equal( + moment().subtract({ m: 3 }).fromNow(), + 'před 3 minutami', + '3 minutes ago' + ); + assert.equal( + moment().subtract({ m: 10 }).fromNow(), + 'před 10 minutami', + '10 minutes ago' + ); + assert.equal( + moment().subtract({ h: 1 }).fromNow(), + 'před hodinou', + 'an hour ago' + ); + assert.equal( + moment().subtract({ h: 3 }).fromNow(), + 'před 3 hodinami', + '3 hours ago' + ); + assert.equal( + moment().subtract({ h: 10 }).fromNow(), + 'před 10 hodinami', + '10 hours ago' + ); + assert.equal( + moment().subtract({ d: 1 }).fromNow(), + 'před dnem', + 'a day ago' + ); + assert.equal( + moment().subtract({ d: 3 }).fromNow(), + 'před 3 dny', + '3 days ago' + ); + assert.equal( + moment().subtract({ d: 10 }).fromNow(), + 'před 10 dny', + '10 days ago' + ); + assert.equal( + moment().subtract({ M: 1 }).fromNow(), + 'před měsícem', + 'a month ago' + ); + assert.equal( + moment().subtract({ M: 3 }).fromNow(), + 'před 3 měsíci', + '3 months ago' + ); + assert.equal( + moment().subtract({ M: 10 }).fromNow(), + 'před 10 měsíci', + '10 months ago' + ); + assert.equal( + moment().subtract({ y: 1 }).fromNow(), + 'před rokem', + 'a year ago' + ); + assert.equal( + moment().subtract({ y: 3 }).fromNow(), + 'před 3 lety', + '3 years ago' + ); + assert.equal( + moment().subtract({ y: 10 }).fromNow(), + 'před 10 lety', + '10 years ago' + ); + }); + + test('calendar day', function (assert) { + var a = moment().hours(12).minutes(0).seconds(0); + + assert.equal( + moment(a).calendar(), + 'dnes v 12:00', + 'today at the same time' + ); + assert.equal( + moment(a).add({ m: 25 }).calendar(), + 'dnes v 12:25', + 'Now plus 25 min' + ); + assert.equal( + moment(a).add({ h: 1 }).calendar(), + 'dnes v 13:00', + 'Now plus 1 hour' + ); + assert.equal( + moment(a).add({ d: 1 }).calendar(), + 'zítra v 12:00', + 'tomorrow at the same time' + ); + assert.equal( + moment(a).subtract({ h: 1 }).calendar(), + 'dnes v 11:00', + 'Now minus 1 hour' + ); + assert.equal( + moment(a).subtract({ d: 1 }).calendar(), + 'včera v 12:00', + 'yesterday at the same time' + ); + }); + + test('calendar next week', function (assert) { + var i, m, nextDay; + for (i = 2; i < 7; i++) { + m = moment().add({ d: i }); + nextDay = ''; + switch (m.day()) { + case 0: + nextDay = 'v neděli'; + break; + case 1: + nextDay = 'v pondělí'; + break; + case 2: + nextDay = 'v úterý'; + break; + case 3: + nextDay = 've středu'; + break; + case 4: + nextDay = 've čtvrtek'; + break; + case 5: + nextDay = 'v pátek'; + break; + case 6: + nextDay = 'v sobotu'; + break; + } + assert.equal( + m.calendar(), + m.format('[' + nextDay + '] [v] LT'), + 'Today + ' + i + ' days current time' + ); + m.hours(0).minutes(0).seconds(0).milliseconds(0); + assert.equal( + m.calendar(), + m.format('[' + nextDay + '] [v] LT'), + 'Today + ' + i + ' days beginning of day' + ); + m.hours(23).minutes(59).seconds(59).milliseconds(999); + assert.equal( + m.calendar(), + m.format('[' + nextDay + '] [v] LT'), + 'Today + ' + i + ' days end of day' + ); + } + }); + + test('calendar last week', function (assert) { + var i, m, lastDay; + for (i = 2; i < 7; i++) { + m = moment().subtract({ d: i }); + lastDay = ''; + switch (m.day()) { + case 0: + lastDay = 'minulou neděli'; + break; + case 1: + lastDay = 'minulé pondělí'; + break; + case 2: + lastDay = 'minulé úterý'; + break; + case 3: + lastDay = 'minulou středu'; + break; + case 4: + lastDay = 'minulý čtvrtek'; + break; + case 5: + lastDay = 'minulý pátek'; + break; + case 6: + lastDay = 'minulou sobotu'; + break; + } + assert.equal( + m.calendar(), + m.format('[' + lastDay + '] [v] LT'), + 'Today - ' + i + ' days current time' + ); + m.hours(0).minutes(0).seconds(0).milliseconds(0); + assert.equal( + m.calendar(), + m.format('[' + lastDay + '] [v] LT'), + 'Today - ' + i + ' days beginning of day' + ); + m.hours(23).minutes(59).seconds(59).milliseconds(999); + assert.equal( + m.calendar(), + m.format('[' + lastDay + '] [v] LT'), + 'Today - ' + i + ' days end of day' + ); + } + }); + + test('calendar all else', function (assert) { + var weeksAgo = moment().subtract({ w: 1 }), + weeksFromNow = moment().add({ w: 1 }); + + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 week ago'); + assert.equal( + weeksFromNow.calendar(), + weeksFromNow.format('L'), + 'in 1 week' + ); + + weeksAgo = moment().subtract({ w: 2 }); + weeksFromNow = moment().add({ w: 2 }); + + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 weeks ago'); + assert.equal( + weeksFromNow.calendar(), + weeksFromNow.format('L'), + 'in 2 weeks' + ); + }); + + test('humanize duration', function (assert) { + assert.equal( + moment.duration(1, 'minutes').humanize(), + 'minuta', + 'a minute (future)' + ); + assert.equal( + moment.duration(1, 'minutes').humanize(true), + 'za minutu', + 'in a minute' + ); + assert.equal( + moment.duration(-1, 'minutes').humanize(), + 'minuta', + 'a minute (past)' + ); + assert.equal( + moment.duration(-1, 'minutes').humanize(true), + 'před minutou', + 'a minute ago' + ); + }); + + test('weeks year starting sunday formatted', function (assert) { + assert.equal( + moment([2012, 0, 1]).format('w ww wo'), + '52 52 52.', + 'Jan 1 2012 should be week 52' + ); + assert.equal( + moment([2012, 0, 2]).format('w ww wo'), + '1 01 1.', + 'Jan 2 2012 should be week 1' + ); + assert.equal( + moment([2012, 0, 8]).format('w ww wo'), + '1 01 1.', + 'Jan 8 2012 should be week 1' + ); + assert.equal( + moment([2012, 0, 9]).format('w ww wo'), + '2 02 2.', + 'Jan 9 2012 should be week 2' + ); + assert.equal( + moment([2012, 0, 15]).format('w ww wo'), + '2 02 2.', + 'Jan 15 2012 should be week 2' + ); + }); + +}))); + + + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : + typeof define === 'function' && define.amd ? define(['../../moment'], factory) : + factory(global.moment) +}(this, (function (moment) { 'use strict'; + + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function setupDeprecationHandler(test, moment, scope) { + test._expectedDeprecations = null; + test._observedDeprecations = null; + test._oldSupress = moment.suppressDeprecationWarnings; + moment.suppressDeprecationWarnings = true; + test.expectedDeprecations = function () { + test._expectedDeprecations = arguments; + test._observedDeprecations = []; + }; + moment.deprecationHandler = function (name, msg) { + var deprecationId = matchedDeprecation( + name, + msg, + test._expectedDeprecations + ); + if (deprecationId === -1) { + throw new Error( + 'Unexpected deprecation thrown name=' + name + ' msg=' + msg + ); + } + test._observedDeprecations[deprecationId] = 1; + }; + } + + function teardownDeprecationHandler(test, moment, scope) { + moment.suppressDeprecationWarnings = test._oldSupress; + + if (test._expectedDeprecations != null) { + var missedDeprecations = []; + each(test._expectedDeprecations, function (deprecationPattern, id) { + if (test._observedDeprecations[id] !== 1) { + missedDeprecations.push(deprecationPattern); + } + }); + if (missedDeprecations.length !== 0) { + throw new Error( + 'Expected deprecation warnings did not happen: ' + + missedDeprecations.join(' ') + ); + } + } + } + + function matchedDeprecation(name, msg, deprecations) { + if (deprecations == null) { + return -1; + } + for (var i = 0; i < deprecations.length; ++i) { + if (name != null && name === deprecations[i]) { + return i; + } + if ( + msg != null && + msg.substring(0, deprecations[i].length) === deprecations[i] + ) { + return i; + } + } + return -1; + } + + /*global QUnit:false*/ + + var test = QUnit.test, + only = QUnit.only; + + function hasOwnProp(a, b) { + return Object.prototype.hasOwnProperty.call(a, b); + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], + i; + for (i in obj) { + if (hasOwnProp(obj, i)) { + res.push(i); + } + } + return res; + } + } + + function eachOwnProp(object, callback) { + each(objectKeys(object), callback); + } + + function defineCommonLocaleTests(locale, options) { + test('lenient day of month ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal( + testMoment.year(), + 2014, + 'lenient day of month ordinal parsing ' + i + ' year check' + ); + assert.equal( + testMoment.month(), + 0, + 'lenient day of month ordinal parsing ' + i + ' month check' + ); + assert.equal( + testMoment.date(), + i, + 'lenient day of month ordinal parsing ' + i + ' date check' + ); + } + }); + + test('lenient day of month ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal( + testMoment.year(), + 2014, + 'lenient day of month ordinal parsing of number ' + + i + + ' year check' + ); + assert.equal( + testMoment.month(), + 0, + 'lenient day of month ordinal parsing of number ' + + i + + ' month check' + ); + assert.equal( + testMoment.date(), + i, + 'lenient day of month ordinal parsing of number ' + + i + + ' date check' + ); + } + }); + + test('strict day of month ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok( + testMoment.isValid(), + 'strict day of month ordinal parsing ' + i + ); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment.utc(t1.format('A h:mm'), 'A h:mm'); + assert.equal( + t2.format('HH:mm'), + t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm') + ); + } + } + }); + + test('date format correctness', function (assert) { + var data = moment.localeData()._longDateFormat; + eachOwnProp(data, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + eachOwnProp(data, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal( + false, + !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken + ); + }); + }); + }); + + test('month parsing correctness', function (assert) { + var i, m; + + if (locale === 'tr') { + // I can't fix it :( + assert.expect(0); + return; + } + function tester(format) { + var r; + r = moment(m.format(format), format); + assert.equal(r.month(), m.month(), 'month ' + i + ' fmt ' + format); + if (locale !== 'ka') { + r = moment(m.format(format).toLocaleUpperCase(), format); + assert.equal( + r.month(), + m.month(), + 'month ' + i + ' fmt ' + format + ' upper' + ); + } + r = moment(m.format(format).toLocaleLowerCase(), format); + assert.equal( + r.month(), + m.month(), + 'month ' + i + ' fmt ' + format + ' lower' + ); + + r = moment(m.format(format), format, true); + assert.equal( + r.month(), + m.month(), + 'month ' + i + ' fmt ' + format + ' strict' + ); + if (locale !== 'ka') { + r = moment(m.format(format).toLocaleUpperCase(), format, true); + assert.equal( + r.month(), + m.month(), + 'month ' + i + ' fmt ' + format + ' upper strict' + ); + } + r = moment(m.format(format).toLocaleLowerCase(), format, true); + assert.equal( + r.month(), + m.month(), + 'month ' + i + ' fmt ' + format + ' lower strict' + ); + } + + for (i = 0; i < 12; ++i) { + m = moment([2015, i, 15, 18]); + tester('MMM'); + tester('MMM.'); + tester('MMMM'); + tester('MMMM.'); + } + }); + + test('weekday parsing correctness', function (assert) { + var i, m; + + if ( + locale === 'tr' || + locale === 'az' || + locale === 'ro' || + locale === 'mt' || + locale === 'ga' + ) { + // tr, az: There is a lower-case letter (ı), that converted to + // upper then lower changes to i + // ro: there is the letter ț which behaves weird under IE8 + // mt: letter Ħ + // ga: month with spaces + assert.expect(0); + return; + } + function tester(format) { + var r, + baseMsg = + 'weekday ' + + m.weekday() + + ' fmt ' + + format + + ' ' + + m.toISOString(); + r = moment(m.format(format), format); + assert.equal(r.weekday(), m.weekday(), baseMsg); + if (locale !== 'ka') { + r = moment(m.format(format).toLocaleUpperCase(), format); + assert.equal(r.weekday(), m.weekday(), baseMsg + ' upper'); + } + r = moment(m.format(format).toLocaleLowerCase(), format); + assert.equal(r.weekday(), m.weekday(), baseMsg + ' lower'); + r = moment(m.format(format), format, true); + assert.equal(r.weekday(), m.weekday(), baseMsg + ' strict'); + if (locale !== 'ka') { + r = moment(m.format(format).toLocaleUpperCase(), format, true); + assert.equal( + r.weekday(), + m.weekday(), + baseMsg + ' upper strict' + ); + } + r = moment(m.format(format).toLocaleLowerCase(), format, true); + assert.equal(r.weekday(), m.weekday(), baseMsg + ' lower strict'); + } + + for (i = 0; i < 7; ++i) { + m = moment.utc([2015, 0, i + 1, 18]); + tester('dd'); + tester('ddd'); + tester('dddd'); + } + }); + + test('valid localeData', function (assert) { + assert.equal( + moment().localeData().months().length, + 12, + 'months should return 12 months' + ); + assert.equal( + moment().localeData().monthsShort().length, + 12, + 'monthsShort should return 12 months' + ); + assert.equal( + moment().localeData().weekdays().length, + 7, + 'weekdays should return 7 days' + ); + assert.equal( + moment().localeData().weekdaysShort().length, + 7, + 'weekdaysShort should return 7 days' + ); + assert.equal( + moment().localeData().weekdaysMin().length, + 7, + 'monthsShort should return 7 days' + ); + }); + + test('localeData weekdays can localeSort', function (assert) { + var weekdays = moment().localeData().weekdays(), + weekdaysShort = moment().localeData().weekdaysShort(), + weekdaysMin = moment().localeData().weekdaysMin(), + shift = moment().localeData()._week.dow; + assert.deepEqual( + moment().localeData().weekdays(true), + weekdays.slice(shift, 7).concat(weekdays.slice(0, shift)), + 'weekdays should localeSort' + ); + assert.deepEqual( + moment().localeData().weekdaysShort(true), + weekdaysShort.slice(shift, 7).concat(weekdaysShort.slice(0, shift)), + 'weekdaysShort should localeSort' + ); + assert.deepEqual( + moment().localeData().weekdaysMin(true), + weekdaysMin.slice(shift, 7).concat(weekdaysMin.slice(0, shift)), + 'weekdaysMin should localeSort' + ); + }); + } + + /*global QUnit:false*/ + + function localeModule(name, lifecycle) { + QUnit.module('locale:' + name, { + beforeEach: function () { + moment.locale(name); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + setupDeprecationHandler(test, moment); + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + afterEach: function () { + moment.locale('en'); + teardownDeprecationHandler(test, moment); + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + }, + }); + defineCommonLocaleTests(name); + } + + localeModule('cv'); test('parse', function (assert) { - var tests = 'leden led ledna_únor úno února_březen bře března_duben dub dubna_květen kvě května_červen čvn června_červenec čvc července_srpen srp srpna_září zář září_říjen říj října_listopad lis listopadu_prosinec pro prosince'.split( + var tests = 'кӑрлач кӑр_нарӑс нар_пуш пуш_ака ака_май май_ҫӗртме ҫӗр_утӑ утӑ_ҫурла ҫур_авӑн авн_юпа юпа_чӳк чӳк_раштав раш'.split( '_' ), i; - function equalTest(input, mmm, monthIndex) { + function equalTest(input, mmm, i) { assert.equal( moment(input, mmm).month(), - monthIndex, - input + ' ' + mmm + ' should be month ' + (monthIndex + 1) + i, + input + ' should be month ' + (i + 1) ); } + function equalTestStrict(input, mmm, monthIndex) { assert.equal( moment(input, mmm, true).month(), @@ -15399,58 +17294,55 @@ input + ' ' + mmm + ' should be strict month ' + (monthIndex + 1) ); } + for (i = 0; i < 12; i++) { tests[i] = tests[i].split(' '); equalTest(tests[i][0], 'MMM', i); equalTest(tests[i][1], 'MMM', i); - equalTest(tests[i][2], 'MMM', i); equalTest(tests[i][0], 'MMMM', i); equalTest(tests[i][1], 'MMMM', i); - equalTest(tests[i][2], 'MMMM', i); equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i); equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i); - equalTest(tests[i][2].toLocaleLowerCase(), 'MMMM', i); equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i); equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i); - equalTest(tests[i][2].toLocaleUpperCase(), 'MMMM', i); equalTestStrict(tests[i][1], 'MMM', i); equalTestStrict(tests[i][0], 'MMMM', i); - equalTestStrict(tests[i][2], 'MMMM', i); equalTestStrict(tests[i][1].toLocaleLowerCase(), 'MMM', i); equalTestStrict(tests[i][1].toLocaleUpperCase(), 'MMM', i); equalTestStrict(tests[i][0].toLocaleLowerCase(), 'MMMM', i); equalTestStrict(tests[i][0].toLocaleUpperCase(), 'MMMM', i); - equalTestStrict(tests[i][2].toLocaleLowerCase(), 'MMMM', i); - equalTestStrict(tests[i][2].toLocaleUpperCase(), 'MMMM', i); } }); test('format', function (assert) { var a = [ - ['dddd, MMMM Do YYYY, h:mm:ss', 'neděle, únor 14. 2010, 3:25:50'], - ['ddd, h', 'ne, 3'], - ['M Mo MM MMMM MMM', '2 2. 02 únor úno'], + [ + 'dddd, MMMM Do YYYY, h:mm:ss a', + 'вырсарникун, нарӑс 14-мӗш 2010, 3:25:50 pm', + ], + ['ddd, hA', 'выр, 3PM'], + ['M Mo MM MMMM MMM', '2 2-мӗш 02 нарӑс нар'], ['YYYY YY', '2010 10'], - ['D Do DD', '14 14. 14'], - ['d do dddd ddd dd', '0 0. neděle ne ne'], - ['DDD DDDo DDDD', '45 45. 045'], - ['w wo ww', '6 6. 06'], + ['D Do DD', '14 14-мӗш 14'], + ['d do dddd ddd dd', '0 0-мӗш вырсарникун выр вр'], + ['DDD DDDo DDDD', '45 45-мӗш 045'], + ['w wo ww', '7 7-мӗш 07'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], ['a A', 'pm PM'], - ['DDDo [den v roce]', '45. den v roce'], + ['Ҫулӑн DDDo кунӗ', 'Ҫулӑн 45-мӗш кунӗ'], ['LTS', '15:25:50'], - ['L', '14.02.2010'], - ['LL', '14. únor 2010'], - ['LLL', '14. únor 2010 15:25'], - ['LLLL', 'neděle 14. únor 2010 15:25'], - ['l', '14. 2. 2010'], - ['ll', '14. úno 2010'], - ['lll', '14. úno 2010 15:25'], - ['llll', 'ne 14. úno 2010 15:25'], + ['L', '14-02-2010'], + ['LL', '2010 ҫулхи нарӑс уйӑхӗн 14-мӗшӗ'], + ['LLL', '2010 ҫулхи нарӑс уйӑхӗн 14-мӗшӗ, 15:25'], + ['LLLL', 'вырсарникун, 2010 ҫулхи нарӑс уйӑхӗн 14-мӗшӗ, 15:25'], + ['l', '14-2-2010'], + ['ll', '2010 ҫулхи нар уйӑхӗн 14-мӗшӗ'], + ['lll', '2010 ҫулхи нар уйӑхӗн 14-мӗшӗ, 15:25'], + ['llll', 'выр, 2010 ҫулхи нар уйӑхӗн 14-мӗшӗ, 15:25'], ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -15460,44 +17352,44 @@ }); test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.'); + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1-мӗш', '1-мӗш'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2-мӗш', '2-мӗш'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3-мӗш', '3-мӗш'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4-мӗш', '4-мӗш'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5-мӗш', '5-мӗш'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6-мӗш', '6-мӗш'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7-мӗш', '7-мӗш'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8-мӗш', '8-мӗш'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9-мӗш', '9-мӗш'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10-мӗш', '10-мӗш'); - assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.'); + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11-мӗш', '11-мӗш'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12-мӗш', '12-мӗш'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13-мӗш', '13-мӗш'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14-мӗш', '14-мӗш'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15-мӗш', '15-мӗш'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16-мӗш', '16-мӗш'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17-мӗш', '17-мӗш'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18-мӗш', '18-мӗш'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19-мӗш', '19-мӗш'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20-мӗш', '20-мӗш'); - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.'); + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21-мӗш', '21-мӗш'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22-мӗш', '22-мӗш'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23-мӗш', '23-мӗш'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24-мӗш', '24-мӗш'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25-мӗш', '25-мӗш'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26-мӗш', '26-мӗш'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27-мӗш', '27-мӗш'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28-мӗш', '28-мӗш'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29-мӗш', '29-мӗш'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30-мӗш', '30-мӗш'); - assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31-мӗш', '31-мӗш'); }); test('format month', function (assert) { - var expected = 'leden led_únor úno_březen bře_duben dub_květen kvě_červen čvn_červenec čvc_srpen srp_září zář_říjen říj_listopad lis_prosinec pro'.split( + var expected = 'кӑрлач кӑр_нарӑс нар_пуш пуш_ака ака_май май_ҫӗртме ҫӗр_утӑ утӑ_ҫурла ҫур_авӑн авн_юпа юпа_чӳк чӳк_раштав раш'.split( '_' ), i; @@ -15511,7 +17403,7 @@ }); test('format week', function (assert) { - var expected = 'neděle ne ne_pondělí po po_úterý út út_středa st st_čtvrtek čt čt_pátek pá pá_sobota so so'.split( + var expected = 'вырсарникун выр вр_тунтикун тун тн_ытларикун ытл ыт_юнкун юн юн_кӗҫнерникун кӗҫ кҫ_эрнекун эрн эр_шӑматкун шӑм шм'.split( '_' ), i; @@ -15528,411 +17420,257 @@ var start = moment([2007, 1, 28]); assert.equal( start.from(moment([2007, 1, 28]).add({ s: 44 }), true), - 'pár sekund', - '44 seconds = a few seconds' + 'пӗр-ик ҫеккунт', + '44 sekunder = a few seconds' ); assert.equal( start.from(moment([2007, 1, 28]).add({ s: 45 }), true), - 'minuta', + 'пӗр минут', '45 seconds = a minute' ); assert.equal( start.from(moment([2007, 1, 28]).add({ s: 89 }), true), - 'minuta', + 'пӗр минут', '89 seconds = a minute' ); assert.equal( start.from(moment([2007, 1, 28]).add({ s: 90 }), true), - '2 minuty', + '2 минут', '90 seconds = 2 minutes' ); assert.equal( start.from(moment([2007, 1, 28]).add({ m: 44 }), true), - '44 minut', + '44 минут', '44 minutes = 44 minutes' ); assert.equal( start.from(moment([2007, 1, 28]).add({ m: 45 }), true), - 'hodina', + 'пӗр сехет', '45 minutes = an hour' ); assert.equal( start.from(moment([2007, 1, 28]).add({ m: 89 }), true), - 'hodina', + 'пӗр сехет', '89 minutes = an hour' ); assert.equal( start.from(moment([2007, 1, 28]).add({ m: 90 }), true), - '2 hodiny', + '2 сехет', '90 minutes = 2 hours' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 5 }), true), - '5 hodin', + '5 сехет', '5 hours = 5 hours' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 21 }), true), - '21 hodin', + '21 сехет', '21 hours = 21 hours' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 22 }), true), - 'den', + 'пӗр кун', '22 hours = a day' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 35 }), true), - 'den', + 'пӗр кун', '35 hours = a day' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 36 }), true), - '2 dny', + '2 кун', '36 hours = 2 days' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 1 }), true), - 'den', + 'пӗр кун', '1 day = a day' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 5 }), true), - '5 dní', + '5 кун', '5 days = 5 days' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 25 }), true), - '25 dní', + '25 кун', '25 days = 25 days' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 26 }), true), - 'měsíc', + 'пӗр уйӑх', '26 days = a month' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 30 }), true), - 'měsíc', + 'пӗр уйӑх', '30 days = a month' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 43 }), true), - 'měsíc', + 'пӗр уйӑх', '43 days = a month' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 46 }), true), - '2 měsíce', + '2 уйӑх', '46 days = 2 months' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 74 }), true), - '2 měsíce', + '2 уйӑх', '75 days = 2 months' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 76 }), true), - '3 měsíce', + '3 уйӑх', '76 days = 3 months' ); assert.equal( start.from(moment([2007, 1, 28]).add({ M: 1 }), true), - 'měsíc', + 'пӗр уйӑх', '1 month = a month' ); assert.equal( start.from(moment([2007, 1, 28]).add({ M: 5 }), true), - '5 měsíců', + '5 уйӑх', '5 months = 5 months' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 345 }), true), - 'rok', + 'пӗр ҫул', '345 days = a year' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 548 }), true), - '2 roky', + '2 ҫул', '548 days = 2 years' ); assert.equal( start.from(moment([2007, 1, 28]).add({ y: 1 }), true), - 'rok', + 'пӗр ҫул', '1 year = a year' ); assert.equal( start.from(moment([2007, 1, 28]).add({ y: 5 }), true), - '5 let', + '5 ҫул', '5 years = 5 years' ); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'za pár sekund', 'prefix'); - assert.equal(moment(0).from(30000), 'před pár sekundami', 'suffix'); + assert.equal(moment(30000).from(0), 'пӗр-ик ҫеккунтран', 'prefix'); + assert.equal(moment(0).from(30000), 'пӗр-ик ҫеккунт каялла', 'suffix'); }); test('now from now', function (assert) { assert.equal( moment().fromNow(), - 'před pár sekundami', + 'пӗр-ик ҫеккунт каялла', 'now from now should display as in the past' ); }); - test('fromNow (future)', function (assert) { + test('fromNow', function (assert) { assert.equal( moment().add({ s: 30 }).fromNow(), - 'za pár sekund', + 'пӗр-ик ҫеккунтран', 'in a few seconds' ); - assert.equal(moment().add({ m: 1 }).fromNow(), 'za minutu', 'in a minute'); - assert.equal( - moment().add({ m: 3 }).fromNow(), - 'za 3 minuty', - 'in 3 minutes' - ); - assert.equal( - moment().add({ m: 10 }).fromNow(), - 'za 10 minut', - 'in 10 minutes' - ); - assert.equal(moment().add({ h: 1 }).fromNow(), 'za hodinu', 'in an hour'); - assert.equal(moment().add({ h: 3 }).fromNow(), 'za 3 hodiny', 'in 3 hours'); - assert.equal( - moment().add({ h: 10 }).fromNow(), - 'za 10 hodin', - 'in 10 hours' - ); - assert.equal(moment().add({ d: 1 }).fromNow(), 'za den', 'in a day'); - assert.equal(moment().add({ d: 3 }).fromNow(), 'za 3 dny', 'in 3 days'); - assert.equal(moment().add({ d: 10 }).fromNow(), 'za 10 dní', 'in 10 days'); - assert.equal(moment().add({ M: 1 }).fromNow(), 'za měsíc', 'in a month'); - assert.equal( - moment().add({ M: 3 }).fromNow(), - 'za 3 měsíce', - 'in 3 months' - ); - assert.equal( - moment().add({ M: 10 }).fromNow(), - 'za 10 měsíců', - 'in 10 months' - ); - assert.equal(moment().add({ y: 1 }).fromNow(), 'za rok', 'in a year'); - assert.equal(moment().add({ y: 3 }).fromNow(), 'za 3 roky', 'in 3 years'); - assert.equal(moment().add({ y: 10 }).fromNow(), 'za 10 let', 'in 10 years'); - }); - - test('fromNow (past)', function (assert) { - assert.equal( - moment().subtract({ s: 30 }).fromNow(), - 'před pár sekundami', - 'a few seconds ago' - ); - assert.equal( - moment().subtract({ m: 1 }).fromNow(), - 'před minutou', - 'a minute ago' - ); - assert.equal( - moment().subtract({ m: 3 }).fromNow(), - 'před 3 minutami', - '3 minutes ago' - ); - assert.equal( - moment().subtract({ m: 10 }).fromNow(), - 'před 10 minutami', - '10 minutes ago' - ); - assert.equal( - moment().subtract({ h: 1 }).fromNow(), - 'před hodinou', - 'an hour ago' - ); - assert.equal( - moment().subtract({ h: 3 }).fromNow(), - 'před 3 hodinami', - '3 hours ago' - ); - assert.equal( - moment().subtract({ h: 10 }).fromNow(), - 'před 10 hodinami', - '10 hours ago' - ); - assert.equal( - moment().subtract({ d: 1 }).fromNow(), - 'před dnem', - 'a day ago' - ); - assert.equal( - moment().subtract({ d: 3 }).fromNow(), - 'před 3 dny', - '3 days ago' - ); - assert.equal( - moment().subtract({ d: 10 }).fromNow(), - 'před 10 dny', - '10 days ago' - ); - assert.equal( - moment().subtract({ M: 1 }).fromNow(), - 'před měsícem', - 'a month ago' - ); - assert.equal( - moment().subtract({ M: 3 }).fromNow(), - 'před 3 měsíci', - '3 months ago' - ); - assert.equal( - moment().subtract({ M: 10 }).fromNow(), - 'před 10 měsíci', - '10 months ago' - ); - assert.equal( - moment().subtract({ y: 1 }).fromNow(), - 'před rokem', - 'a year ago' - ); + assert.equal(moment().add({ d: 5 }).fromNow(), '5 кунран', 'in 5 days'); assert.equal( - moment().subtract({ y: 3 }).fromNow(), - 'před 3 lety', - '3 years ago' + moment().add({ h: 2 }).fromNow(), + '2 сехетрен', + 'in 2 hours, the right suffix!' ); assert.equal( - moment().subtract({ y: 10 }).fromNow(), - 'před 10 lety', - '10 years ago' + moment().add({ y: 3 }).fromNow(), + '3 ҫултан', + 'in 3 years, the right suffix!' ); }); test('calendar day', function (assert) { var a = moment().hours(12).minutes(0).seconds(0); - assert.equal( moment(a).calendar(), - 'dnes v 12:00', + 'Паян 12:00 сехетре', 'today at the same time' ); assert.equal( moment(a).add({ m: 25 }).calendar(), - 'dnes v 12:25', + 'Паян 12:25 сехетре', 'Now plus 25 min' ); assert.equal( moment(a).add({ h: 1 }).calendar(), - 'dnes v 13:00', + 'Паян 13:00 сехетре', 'Now plus 1 hour' ); assert.equal( moment(a).add({ d: 1 }).calendar(), - 'zítra v 12:00', + 'Ыран 12:00 сехетре', 'tomorrow at the same time' ); assert.equal( moment(a).subtract({ h: 1 }).calendar(), - 'dnes v 11:00', + 'Паян 11:00 сехетре', 'Now minus 1 hour' ); assert.equal( moment(a).subtract({ d: 1 }).calendar(), - 'včera v 12:00', + 'Ӗнер 12:00 сехетре', 'yesterday at the same time' ); }); test('calendar next week', function (assert) { - var i, m, nextDay; + var i, m; + for (i = 2; i < 7; i++) { m = moment().add({ d: i }); - nextDay = ''; - switch (m.day()) { - case 0: - nextDay = 'v neděli'; - break; - case 1: - nextDay = 'v pondělí'; - break; - case 2: - nextDay = 'v úterý'; - break; - case 3: - nextDay = 've středu'; - break; - case 4: - nextDay = 've čtvrtek'; - break; - case 5: - nextDay = 'v pátek'; - break; - case 6: - nextDay = 'v sobotu'; - break; - } assert.equal( m.calendar(), - m.format('[' + nextDay + '] [v] LT'), + m.format('[Ҫитес] dddd LT [сехетре]'), 'Today + ' + i + ' days current time' ); m.hours(0).minutes(0).seconds(0).milliseconds(0); assert.equal( m.calendar(), - m.format('[' + nextDay + '] [v] LT'), + m.format('[Ҫитес] dddd LT [сехетре]'), 'Today + ' + i + ' days beginning of day' ); m.hours(23).minutes(59).seconds(59).milliseconds(999); assert.equal( m.calendar(), - m.format('[' + nextDay + '] [v] LT'), + m.format('[Ҫитес] dddd LT [сехетре]'), 'Today + ' + i + ' days end of day' ); } }); test('calendar last week', function (assert) { - var i, m, lastDay; + var i, m; + for (i = 2; i < 7; i++) { m = moment().subtract({ d: i }); - lastDay = ''; - switch (m.day()) { - case 0: - lastDay = 'minulou neděli'; - break; - case 1: - lastDay = 'minulé pondělí'; - break; - case 2: - lastDay = 'minulé úterý'; - break; - case 3: - lastDay = 'minulou středu'; - break; - case 4: - lastDay = 'minulý čtvrtek'; - break; - case 5: - lastDay = 'minulý pátek'; - break; - case 6: - lastDay = 'minulou sobotu'; - break; - } assert.equal( m.calendar(), - m.format('[' + lastDay + '] [v] LT'), + m.format('[Иртнӗ] dddd LT [сехетре]'), 'Today - ' + i + ' days current time' ); m.hours(0).minutes(0).seconds(0).milliseconds(0); assert.equal( m.calendar(), - m.format('[' + lastDay + '] [v] LT'), + m.format('[Иртнӗ] dddd LT [сехетре]'), 'Today - ' + i + ' days beginning of day' ); m.hours(23).minutes(59).seconds(59).milliseconds(999); assert.equal( m.calendar(), - m.format('[' + lastDay + '] [v] LT'), + m.format('[Иртнӗ] dddd LT [сехетре]'), 'Today - ' + i + ' days end of day' ); } @@ -15960,54 +17698,34 @@ ); }); - test('humanize duration', function (assert) { - assert.equal( - moment.duration(1, 'minutes').humanize(), - 'minuta', - 'a minute (future)' - ); - assert.equal( - moment.duration(1, 'minutes').humanize(true), - 'za minutu', - 'in a minute' - ); - assert.equal( - moment.duration(-1, 'minutes').humanize(), - 'minuta', - 'a minute (past)' - ); - assert.equal( - moment.duration(-1, 'minutes').humanize(true), - 'před minutou', - 'a minute ago' - ); - }); + // Monday is the first day of the week. + // The week that contains Jan 1st is the first week of the year. test('weeks year starting sunday formatted', function (assert) { + assert.equal( + moment([2011, 11, 26]).format('w ww wo'), + '1 01 1-мӗш', + 'Dec 26 2011 should be week 1' + ); assert.equal( moment([2012, 0, 1]).format('w ww wo'), - '52 52 52.', - 'Jan 1 2012 should be week 52' + '1 01 1-мӗш', + 'Jan 1 2012 should be week 1' ); assert.equal( moment([2012, 0, 2]).format('w ww wo'), - '1 01 1.', - 'Jan 2 2012 should be week 1' + '2 02 2-мӗш', + 'Jan 2 2012 should be week 2' ); assert.equal( moment([2012, 0, 8]).format('w ww wo'), - '1 01 1.', - 'Jan 8 2012 should be week 1' + '2 02 2-мӗш', + 'Jan 8 2012 should be week 2' ); assert.equal( moment([2012, 0, 9]).format('w ww wo'), - '2 02 2.', - 'Jan 9 2012 should be week 2' - ); - assert.equal( - moment([2012, 0, 15]).format('w ww wo'), - '2 02 2.', - 'Jan 15 2012 should be week 2' + '3 03 3-мӗш', + 'Jan 9 2012 should be week 3' ); }); @@ -16406,13 +18124,14 @@ defineCommonLocaleTests(name); } - localeModule('cv'); + localeModule('cy'); test('parse', function (assert) { - var tests = 'кӑрлач кӑр_нарӑс нар_пуш пуш_ака ака_май май_ҫӗртме ҫӗр_утӑ утӑ_ҫурла ҫур_авӑн авн_юпа юпа_чӳк чӳк_раштав раш'.split( + var tests = 'Ionawr Ion_Chwefror Chwe_Mawrth Maw_Ebrill Ebr_Mai Mai_Mehefin Meh_Gorffennaf Gor_Awst Aws_Medi Med_Hydref Hyd_Tachwedd Tach_Rhagfyr Rhag'.split( '_' ), i; + function equalTest(input, mmm, i) { assert.equal( moment(input, mmm).month(), @@ -16453,30 +18172,30 @@ var a = [ [ 'dddd, MMMM Do YYYY, h:mm:ss a', - 'вырсарникун, нарӑс 14-мӗш 2010, 3:25:50 pm', + 'Dydd Sul, Chwefror 14eg 2010, 3:25:50 pm', ], - ['ddd, hA', 'выр, 3PM'], - ['M Mo MM MMMM MMM', '2 2-мӗш 02 нарӑс нар'], + ['ddd, hA', 'Sul, 3PM'], + ['M Mo MM MMMM MMM', '2 2il 02 Chwefror Chwe'], ['YYYY YY', '2010 10'], - ['D Do DD', '14 14-мӗш 14'], - ['d do dddd ddd dd', '0 0-мӗш вырсарникун выр вр'], - ['DDD DDDo DDDD', '45 45-мӗш 045'], - ['w wo ww', '7 7-мӗш 07'], + ['D Do DD', '14 14eg 14'], + ['d do dddd ddd dd', '0 0 Dydd Sul Sul Su'], + ['DDD DDDo DDDD', '45 45ain 045'], + ['w wo ww', '6 6ed 06'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], ['a A', 'pm PM'], - ['Ҫулӑн DDDo кунӗ', 'Ҫулӑн 45-мӗш кунӗ'], + ['[the] DDDo [day of the year]', 'the 45ain day of the year'], ['LTS', '15:25:50'], - ['L', '14-02-2010'], - ['LL', '2010 ҫулхи нарӑс уйӑхӗн 14-мӗшӗ'], - ['LLL', '2010 ҫулхи нарӑс уйӑхӗн 14-мӗшӗ, 15:25'], - ['LLLL', 'вырсарникун, 2010 ҫулхи нарӑс уйӑхӗн 14-мӗшӗ, 15:25'], - ['l', '14-2-2010'], - ['ll', '2010 ҫулхи нар уйӑхӗн 14-мӗшӗ'], - ['lll', '2010 ҫулхи нар уйӑхӗн 14-мӗшӗ, 15:25'], - ['llll', 'выр, 2010 ҫулхи нар уйӑхӗн 14-мӗшӗ, 15:25'], + ['L', '14/02/2010'], + ['LL', '14 Chwefror 2010'], + ['LLL', '14 Chwefror 2010 15:25'], + ['LLLL', 'Dydd Sul, 14 Chwefror 2010 15:25'], + ['l', '14/2/2010'], + ['ll', '14 Chwe 2010'], + ['lll', '14 Chwe 2010 15:25'], + ['llll', 'Sul, 14 Chwe 2010 15:25'], ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -16486,44 +18205,44 @@ }); test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1-мӗш', '1-мӗш'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '2-мӗш', '2-мӗш'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '3-мӗш', '3-мӗш'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '4-мӗш', '4-мӗш'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '5-мӗш', '5-мӗш'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '6-мӗш', '6-мӗш'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '7-мӗш', '7-мӗш'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '8-мӗш', '8-мӗш'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '9-мӗш', '9-мӗш'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '10-мӗш', '10-мӗш'); + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1af', '1af'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2il', '2il'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3ydd', '3ydd'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4ydd', '4ydd'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5ed', '5ed'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6ed', '6ed'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7ed', '7ed'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8fed', '8fed'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9fed', '9fed'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10fed', '10fed'); - assert.equal(moment([2011, 0, 11]).format('DDDo'), '11-мӗш', '11-мӗш'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '12-мӗш', '12-мӗш'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '13-мӗш', '13-мӗш'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '14-мӗш', '14-мӗш'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '15-мӗш', '15-мӗш'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '16-мӗш', '16-мӗш'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '17-мӗш', '17-мӗш'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '18-мӗш', '18-мӗш'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '19-мӗш', '19-мӗш'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '20-мӗш', '20-мӗш'); + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11eg', '11eg'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12fed', '12fed'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13eg', '13eg'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14eg', '14eg'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15fed', '15fed'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16eg', '16eg'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17eg', '17eg'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18fed', '18fed'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19eg', '19eg'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20fed', '20fed'); - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21-мӗш', '21-мӗш'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22-мӗш', '22-мӗш'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23-мӗш', '23-мӗш'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24-мӗш', '24-мӗш'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25-мӗш', '25-мӗш'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26-мӗш', '26-мӗш'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27-мӗш', '27-мӗш'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28-мӗш', '28-мӗш'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29-мӗш', '29-мӗш'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30-мӗш', '30-мӗш'); + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21ain', '21ain'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22ain', '22ain'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23ain', '23ain'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24ain', '24ain'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25ain', '25ain'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26ain', '26ain'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27ain', '27ain'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28ain', '28ain'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29ain', '29ain'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30ain', '30ain'); - assert.equal(moment([2011, 0, 31]).format('DDDo'), '31-мӗш', '31-мӗш'); + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31ain', '31ain'); }); test('format month', function (assert) { - var expected = 'кӑрлач кӑр_нарӑс нар_пуш пуш_ака ака_май май_ҫӗртме ҫӗр_утӑ утӑ_ҫурла ҫур_авӑн авн_юпа юпа_чӳк чӳк_раштав раш'.split( + var expected = 'Ionawr Ion_Chwefror Chwe_Mawrth Maw_Ebrill Ebr_Mai Mai_Mehefin Meh_Gorffennaf Gor_Awst Aws_Medi Med_Hydref Hyd_Tachwedd Tach_Rhagfyr Rhag'.split( '_' ), i; @@ -16537,7 +18256,7 @@ }); test('format week', function (assert) { - var expected = 'вырсарникун выр вр_тунтикун тун тн_ытларикун ытл ыт_юнкун юн юн_кӗҫнерникун кӗҫ кҫ_эрнекун эрн эр_шӑматкун шӑм шм'.split( + var expected = 'Dydd Sul Sul Su_Dydd Llun Llun Ll_Dydd Mawrth Maw Ma_Dydd Mercher Mer Me_Dydd Iau Iau Ia_Dydd Gwener Gwe Gw_Dydd Sadwrn Sad Sa'.split( '_' ), i; @@ -16554,208 +18273,195 @@ var start = moment([2007, 1, 28]); assert.equal( start.from(moment([2007, 1, 28]).add({ s: 44 }), true), - 'пӗр-ик ҫеккунт', - '44 sekunder = a few seconds' + 'ychydig eiliadau', + '44 seconds = a few seconds' ); assert.equal( start.from(moment([2007, 1, 28]).add({ s: 45 }), true), - 'пӗр минут', + 'munud', '45 seconds = a minute' ); assert.equal( start.from(moment([2007, 1, 28]).add({ s: 89 }), true), - 'пӗр минут', + 'munud', '89 seconds = a minute' ); assert.equal( start.from(moment([2007, 1, 28]).add({ s: 90 }), true), - '2 минут', + '2 munud', '90 seconds = 2 minutes' ); assert.equal( start.from(moment([2007, 1, 28]).add({ m: 44 }), true), - '44 минут', + '44 munud', '44 minutes = 44 minutes' ); assert.equal( start.from(moment([2007, 1, 28]).add({ m: 45 }), true), - 'пӗр сехет', + 'awr', '45 minutes = an hour' ); assert.equal( start.from(moment([2007, 1, 28]).add({ m: 89 }), true), - 'пӗр сехет', + 'awr', '89 minutes = an hour' ); assert.equal( start.from(moment([2007, 1, 28]).add({ m: 90 }), true), - '2 сехет', + '2 awr', '90 minutes = 2 hours' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 5 }), true), - '5 сехет', + '5 awr', '5 hours = 5 hours' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 21 }), true), - '21 сехет', + '21 awr', '21 hours = 21 hours' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 22 }), true), - 'пӗр кун', + 'diwrnod', '22 hours = a day' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 35 }), true), - 'пӗр кун', + 'diwrnod', '35 hours = a day' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 36 }), true), - '2 кун', + '2 diwrnod', '36 hours = 2 days' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 1 }), true), - 'пӗр кун', + 'diwrnod', '1 day = a day' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 5 }), true), - '5 кун', + '5 diwrnod', '5 days = 5 days' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 25 }), true), - '25 кун', + '25 diwrnod', '25 days = 25 days' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 26 }), true), - 'пӗр уйӑх', + 'mis', '26 days = a month' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 30 }), true), - 'пӗр уйӑх', + 'mis', '30 days = a month' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 43 }), true), - 'пӗр уйӑх', + 'mis', '43 days = a month' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 46 }), true), - '2 уйӑх', + '2 mis', '46 days = 2 months' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 74 }), true), - '2 уйӑх', + '2 mis', '75 days = 2 months' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 76 }), true), - '3 уйӑх', + '3 mis', '76 days = 3 months' ); assert.equal( start.from(moment([2007, 1, 28]).add({ M: 1 }), true), - 'пӗр уйӑх', + 'mis', '1 month = a month' ); assert.equal( start.from(moment([2007, 1, 28]).add({ M: 5 }), true), - '5 уйӑх', + '5 mis', '5 months = 5 months' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 345 }), true), - 'пӗр ҫул', + 'blwyddyn', '345 days = a year' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 548 }), true), - '2 ҫул', + '2 flynedd', '548 days = 2 years' ); assert.equal( start.from(moment([2007, 1, 28]).add({ y: 1 }), true), - 'пӗр ҫул', + 'blwyddyn', '1 year = a year' ); assert.equal( start.from(moment([2007, 1, 28]).add({ y: 5 }), true), - '5 ҫул', + '5 flynedd', '5 years = 5 years' ); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'пӗр-ик ҫеккунтран', 'prefix'); - assert.equal(moment(0).from(30000), 'пӗр-ик ҫеккунт каялла', 'suffix'); - }); - - test('now from now', function (assert) { - assert.equal( - moment().fromNow(), - 'пӗр-ик ҫеккунт каялла', - 'now from now should display as in the past' - ); + assert.equal(moment(30000).from(0), 'mewn ychydig eiliadau', 'prefix'); + assert.equal(moment(0).from(30000), 'ychydig eiliadau yn ôl', 'suffix'); }); test('fromNow', function (assert) { assert.equal( moment().add({ s: 30 }).fromNow(), - 'пӗр-ик ҫеккунтран', + 'mewn ychydig eiliadau', 'in a few seconds' ); - assert.equal(moment().add({ d: 5 }).fromNow(), '5 кунран', 'in 5 days'); - assert.equal( - moment().add({ h: 2 }).fromNow(), - '2 сехетрен', - 'in 2 hours, the right suffix!' - ); assert.equal( - moment().add({ y: 3 }).fromNow(), - '3 ҫултан', - 'in 3 years, the right suffix!' + moment().add({ d: 5 }).fromNow(), + 'mewn 5 diwrnod', + 'in 5 days' ); }); test('calendar day', function (assert) { var a = moment().hours(12).minutes(0).seconds(0); + assert.equal( moment(a).calendar(), - 'Паян 12:00 сехетре', + 'Heddiw am 12:00', 'today at the same time' ); assert.equal( moment(a).add({ m: 25 }).calendar(), - 'Паян 12:25 сехетре', + 'Heddiw am 12:25', 'Now plus 25 min' ); assert.equal( moment(a).add({ h: 1 }).calendar(), - 'Паян 13:00 сехетре', + 'Heddiw am 13:00', 'Now plus 1 hour' ); assert.equal( moment(a).add({ d: 1 }).calendar(), - 'Ыран 12:00 сехетре', + 'Yfory am 12:00', 'tomorrow at the same time' ); assert.equal( moment(a).subtract({ h: 1 }).calendar(), - 'Паян 11:00 сехетре', + 'Heddiw am 11:00', 'Now minus 1 hour' ); assert.equal( moment(a).subtract({ d: 1 }).calendar(), - 'Ӗнер 12:00 сехетре', + 'Ddoe am 12:00', 'yesterday at the same time' ); }); @@ -16767,19 +18473,19 @@ m = moment().add({ d: i }); assert.equal( m.calendar(), - m.format('[Ҫитес] dddd LT [сехетре]'), + m.format('dddd [am] LT'), 'Today + ' + i + ' days current time' ); m.hours(0).minutes(0).seconds(0).milliseconds(0); assert.equal( m.calendar(), - m.format('[Ҫитес] dddd LT [сехетре]'), + m.format('dddd [am] LT'), 'Today + ' + i + ' days beginning of day' ); m.hours(23).minutes(59).seconds(59).milliseconds(999); assert.equal( m.calendar(), - m.format('[Ҫитес] dddd LT [сехетре]'), + m.format('dddd [am] LT'), 'Today + ' + i + ' days end of day' ); } @@ -16792,19 +18498,19 @@ m = moment().subtract({ d: i }); assert.equal( m.calendar(), - m.format('[Иртнӗ] dddd LT [сехетре]'), + m.format('dddd [diwethaf am] LT'), 'Today - ' + i + ' days current time' ); m.hours(0).minutes(0).seconds(0).milliseconds(0); assert.equal( m.calendar(), - m.format('[Иртнӗ] dddd LT [сехетре]'), + m.format('dddd [diwethaf am] LT'), 'Today - ' + i + ' days beginning of day' ); m.hours(23).minutes(59).seconds(59).milliseconds(999); assert.equal( m.calendar(), - m.format('[Иртнӗ] dddd LT [сехетре]'), + m.format('dddd [diwethaf am] LT'), 'Today - ' + i + ' days end of day' ); } @@ -16832,34 +18538,31 @@ ); }); - // Monday is the first day of the week. - // The week that contains Jan 1st is the first week of the year. - test('weeks year starting sunday formatted', function (assert) { - assert.equal( - moment([2011, 11, 26]).format('w ww wo'), - '1 01 1-мӗш', - 'Dec 26 2011 should be week 1' - ); assert.equal( moment([2012, 0, 1]).format('w ww wo'), - '1 01 1-мӗш', - 'Jan 1 2012 should be week 1' + '52 52 52ain', + 'Jan 1 2012 should be week 52' ); assert.equal( moment([2012, 0, 2]).format('w ww wo'), - '2 02 2-мӗш', - 'Jan 2 2012 should be week 2' + '1 01 1af', + 'Jan 2 2012 should be week 1' ); assert.equal( moment([2012, 0, 8]).format('w ww wo'), - '2 02 2-мӗш', - 'Jan 8 2012 should be week 2' + '1 01 1af', + 'Jan 8 2012 should be week 1' ); assert.equal( moment([2012, 0, 9]).format('w ww wo'), - '3 03 3-мӗш', - 'Jan 9 2012 should be week 3' + '2 02 2il', + 'Jan 9 2012 should be week 2' + ); + assert.equal( + moment([2012, 0, 15]).format('w ww wo'), + '2 02 2il', + 'Jan 15 2012 should be week 2' ); }); @@ -17258,14 +18961,13 @@ defineCommonLocaleTests(name); } - localeModule('cy'); + localeModule('da'); test('parse', function (assert) { - var tests = 'Ionawr Ion_Chwefror Chwe_Mawrth Maw_Ebrill Ebr_Mai Mai_Mehefin Meh_Gorffennaf Gor_Awst Aws_Medi Med_Hydref Hyd_Tachwedd Tach_Rhagfyr Rhag'.split( + var tests = 'januar jan_februar feb_marts mar_april apr_maj maj_juni jun_juli jul_august aug_september sep_oktober okt_november nov_december dec'.split( '_' ), i; - function equalTest(input, mmm, i) { assert.equal( moment(input, mmm).month(), @@ -17305,31 +19007,31 @@ test('format', function (assert) { var a = [ [ - 'dddd, MMMM Do YYYY, h:mm:ss a', - 'Dydd Sul, Chwefror 14eg 2010, 3:25:50 pm', + 'dddd [den] Do MMMM YYYY, h:mm:ss a', + 'søndag den 14. februar 2010, 3:25:50 pm', ], - ['ddd, hA', 'Sul, 3PM'], - ['M Mo MM MMMM MMM', '2 2il 02 Chwefror Chwe'], + ['ddd hA', 'søn 3PM'], + ['M Mo MM MMMM MMM', '2 2. 02 februar feb'], ['YYYY YY', '2010 10'], - ['D Do DD', '14 14eg 14'], - ['d do dddd ddd dd', '0 0 Dydd Sul Sul Su'], - ['DDD DDDo DDDD', '45 45ain 045'], - ['w wo ww', '6 6ed 06'], + ['D Do DD', '14 14. 14'], + ['d do dddd ddd dd', '0 0. søndag søn sø'], + ['DDD DDDo DDDD', '45 45. 045'], + ['w wo ww', '6 6. 06'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], ['a A', 'pm PM'], - ['[the] DDDo [day of the year]', 'the 45ain day of the year'], + ['[den] DDDo [dag på året]', 'den 45. dag på året'], ['LTS', '15:25:50'], - ['L', '14/02/2010'], - ['LL', '14 Chwefror 2010'], - ['LLL', '14 Chwefror 2010 15:25'], - ['LLLL', 'Dydd Sul, 14 Chwefror 2010 15:25'], - ['l', '14/2/2010'], - ['ll', '14 Chwe 2010'], - ['lll', '14 Chwe 2010 15:25'], - ['llll', 'Sul, 14 Chwe 2010 15:25'], + ['L', '14.02.2010'], + ['LL', '14. februar 2010'], + ['LLL', '14. februar 2010 15:25'], + ['LLLL', 'søndag d. 14. februar 2010 kl. 15:25'], + ['l', '14.2.2010'], + ['ll', '14. feb 2010'], + ['lll', '14. feb 2010 15:25'], + ['llll', 'søn d. 14. feb 2010 kl. 15:25'], ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -17339,44 +19041,44 @@ }); test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1af', '1af'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '2il', '2il'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '3ydd', '3ydd'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '4ydd', '4ydd'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '5ed', '5ed'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '6ed', '6ed'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '7ed', '7ed'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '8fed', '8fed'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '9fed', '9fed'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '10fed', '10fed'); + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.'); - assert.equal(moment([2011, 0, 11]).format('DDDo'), '11eg', '11eg'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '12fed', '12fed'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '13eg', '13eg'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '14eg', '14eg'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '15fed', '15fed'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '16eg', '16eg'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '17eg', '17eg'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '18fed', '18fed'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '19eg', '19eg'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '20fed', '20fed'); + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.'); - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21ain', '21ain'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22ain', '22ain'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23ain', '23ain'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24ain', '24ain'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25ain', '25ain'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26ain', '26ain'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27ain', '27ain'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28ain', '28ain'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29ain', '29ain'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30ain', '30ain'); + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.'); - assert.equal(moment([2011, 0, 31]).format('DDDo'), '31ain', '31ain'); + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); }); test('format month', function (assert) { - var expected = 'Ionawr Ion_Chwefror Chwe_Mawrth Maw_Ebrill Ebr_Mai Mai_Mehefin Meh_Gorffennaf Gor_Awst Aws_Medi Med_Hydref Hyd_Tachwedd Tach_Rhagfyr Rhag'.split( + var expected = 'januar jan_februar feb_marts mar_april apr_maj maj_juni jun_juli jul_august aug_september sep_oktober okt_november nov_december dec'.split( '_' ), i; @@ -17390,7 +19092,7 @@ }); test('format week', function (assert) { - var expected = 'Dydd Sul Sul Su_Dydd Llun Llun Ll_Dydd Mawrth Maw Ma_Dydd Mercher Mer Me_Dydd Iau Iau Ia_Dydd Gwener Gwe Gw_Dydd Sadwrn Sad Sa'.split( + var expected = 'søndag søn sø_mandag man ma_tirsdag tir ti_onsdag ons on_torsdag tor to_fredag fre fr_lørdag lør lø'.split( '_' ), i; @@ -17407,162 +19109,166 @@ var start = moment([2007, 1, 28]); assert.equal( start.from(moment([2007, 1, 28]).add({ s: 44 }), true), - 'ychydig eiliadau', + 'få sekunder', '44 seconds = a few seconds' ); assert.equal( start.from(moment([2007, 1, 28]).add({ s: 45 }), true), - 'munud', + 'et minut', '45 seconds = a minute' ); assert.equal( start.from(moment([2007, 1, 28]).add({ s: 89 }), true), - 'munud', + 'et minut', '89 seconds = a minute' ); assert.equal( start.from(moment([2007, 1, 28]).add({ s: 90 }), true), - '2 munud', + '2 minutter', '90 seconds = 2 minutes' ); assert.equal( start.from(moment([2007, 1, 28]).add({ m: 44 }), true), - '44 munud', + '44 minutter', '44 minutes = 44 minutes' ); assert.equal( start.from(moment([2007, 1, 28]).add({ m: 45 }), true), - 'awr', + 'en time', '45 minutes = an hour' ); assert.equal( start.from(moment([2007, 1, 28]).add({ m: 89 }), true), - 'awr', + 'en time', '89 minutes = an hour' ); assert.equal( start.from(moment([2007, 1, 28]).add({ m: 90 }), true), - '2 awr', + '2 timer', '90 minutes = 2 hours' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 5 }), true), - '5 awr', + '5 timer', '5 hours = 5 hours' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 21 }), true), - '21 awr', + '21 timer', '21 hours = 21 hours' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 22 }), true), - 'diwrnod', + 'en dag', '22 hours = a day' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 35 }), true), - 'diwrnod', + 'en dag', '35 hours = a day' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 36 }), true), - '2 diwrnod', + '2 dage', '36 hours = 2 days' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 1 }), true), - 'diwrnod', + 'en dag', '1 day = a day' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 5 }), true), - '5 diwrnod', + '5 dage', '5 days = 5 days' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 25 }), true), - '25 diwrnod', + '25 dage', '25 days = 25 days' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 26 }), true), - 'mis', + 'en måned', '26 days = a month' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 30 }), true), - 'mis', + 'en måned', '30 days = a month' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 43 }), true), - 'mis', + 'en måned', '43 days = a month' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 46 }), true), - '2 mis', + '2 måneder', '46 days = 2 months' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 74 }), true), - '2 mis', + '2 måneder', '75 days = 2 months' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 76 }), true), - '3 mis', + '3 måneder', '76 days = 3 months' ); assert.equal( start.from(moment([2007, 1, 28]).add({ M: 1 }), true), - 'mis', + 'en måned', '1 month = a month' ); assert.equal( start.from(moment([2007, 1, 28]).add({ M: 5 }), true), - '5 mis', + '5 måneder', '5 months = 5 months' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 345 }), true), - 'blwyddyn', + 'et år', '345 days = a year' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 548 }), true), - '2 flynedd', + '2 år', '548 days = 2 years' ); assert.equal( start.from(moment([2007, 1, 28]).add({ y: 1 }), true), - 'blwyddyn', + 'et år', '1 year = a year' ); assert.equal( start.from(moment([2007, 1, 28]).add({ y: 5 }), true), - '5 flynedd', + '5 år', '5 years = 5 years' ); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'mewn ychydig eiliadau', 'prefix'); - assert.equal(moment(0).from(30000), 'ychydig eiliadau yn ôl', 'suffix'); + assert.equal(moment(30000).from(0), 'om få sekunder', 'prefix'); + assert.equal(moment(0).from(30000), 'få sekunder siden', 'suffix'); + }); + + test('now from now', function (assert) { + assert.equal( + moment().fromNow(), + 'få sekunder siden', + 'now from now should display as in the past' + ); }); test('fromNow', function (assert) { assert.equal( moment().add({ s: 30 }).fromNow(), - 'mewn ychydig eiliadau', + 'om få sekunder', 'in a few seconds' ); - assert.equal( - moment().add({ d: 5 }).fromNow(), - 'mewn 5 diwrnod', - 'in 5 days' - ); + assert.equal(moment().add({ d: 5 }).fromNow(), 'om 5 dage', 'in 5 days'); }); test('calendar day', function (assert) { @@ -17570,32 +19276,32 @@ assert.equal( moment(a).calendar(), - 'Heddiw am 12:00', + 'i dag kl. 12:00', 'today at the same time' ); assert.equal( moment(a).add({ m: 25 }).calendar(), - 'Heddiw am 12:25', + 'i dag kl. 12:25', 'Now plus 25 min' ); assert.equal( moment(a).add({ h: 1 }).calendar(), - 'Heddiw am 13:00', + 'i dag kl. 13:00', 'Now plus 1 hour' ); assert.equal( moment(a).add({ d: 1 }).calendar(), - 'Yfory am 12:00', + 'i morgen kl. 12:00', 'tomorrow at the same time' ); assert.equal( moment(a).subtract({ h: 1 }).calendar(), - 'Heddiw am 11:00', + 'i dag kl. 11:00', 'Now minus 1 hour' ); assert.equal( moment(a).subtract({ d: 1 }).calendar(), - 'Ddoe am 12:00', + 'i går kl. 12:00', 'yesterday at the same time' ); }); @@ -17607,19 +19313,19 @@ m = moment().add({ d: i }); assert.equal( m.calendar(), - m.format('dddd [am] LT'), + m.format('på dddd [kl.] LT'), 'Today + ' + i + ' days current time' ); m.hours(0).minutes(0).seconds(0).milliseconds(0); assert.equal( m.calendar(), - m.format('dddd [am] LT'), + m.format('på dddd [kl.] LT'), 'Today + ' + i + ' days beginning of day' ); m.hours(23).minutes(59).seconds(59).milliseconds(999); assert.equal( m.calendar(), - m.format('dddd [am] LT'), + m.format('på dddd [kl.] LT'), 'Today + ' + i + ' days end of day' ); } @@ -17632,19 +19338,19 @@ m = moment().subtract({ d: i }); assert.equal( m.calendar(), - m.format('dddd [diwethaf am] LT'), + m.format('[i] dddd[s kl.] LT'), 'Today - ' + i + ' days current time' ); m.hours(0).minutes(0).seconds(0).milliseconds(0); assert.equal( m.calendar(), - m.format('dddd [diwethaf am] LT'), + m.format('[i] dddd[s kl.] LT'), 'Today - ' + i + ' days beginning of day' ); m.hours(23).minutes(59).seconds(59).milliseconds(999); assert.equal( m.calendar(), - m.format('dddd [diwethaf am] LT'), + m.format('[i] dddd[s kl.] LT'), 'Today - ' + i + ' days end of day' ); } @@ -17675,27 +19381,27 @@ test('weeks year starting sunday formatted', function (assert) { assert.equal( moment([2012, 0, 1]).format('w ww wo'), - '52 52 52ain', + '52 52 52.', 'Jan 1 2012 should be week 52' ); assert.equal( moment([2012, 0, 2]).format('w ww wo'), - '1 01 1af', + '1 01 1.', 'Jan 2 2012 should be week 1' ); assert.equal( moment([2012, 0, 8]).format('w ww wo'), - '1 01 1af', + '1 01 1.', 'Jan 8 2012 should be week 1' ); assert.equal( moment([2012, 0, 9]).format('w ww wo'), - '2 02 2il', + '2 02 2.', 'Jan 9 2012 should be week 2' ); assert.equal( moment([2012, 0, 15]).format('w ww wo'), - '2 02 2il', + '2 02 2.', 'Jan 15 2012 should be week 2' ); }); @@ -18095,13 +19801,14 @@ defineCommonLocaleTests(name); } - localeModule('da'); + localeModule('de-at'); test('parse', function (assert) { - var tests = 'januar jan_februar feb_marts mar_april apr_maj maj_juni jun_juli jul_august aug_september sep_oktober okt_november nov_december dec'.split( + var tests = 'Jänner Jän._Februar Feb._März März_April Apr._Mai Mai_Juni Juni_Juli Juli_August Aug._September Sep._Oktober Okt._November Nov._Dezember Dez.'.split( '_' ), i; + function equalTest(input, mmm, i) { assert.equal( moment(input, mmm).month(), @@ -18141,14 +19848,14 @@ test('format', function (assert) { var a = [ [ - 'dddd [den] Do MMMM YYYY, h:mm:ss a', - 'søndag den 14. februar 2010, 3:25:50 pm', + 'dddd, Do MMMM YYYY, h:mm:ss a', + 'Sonntag, 14. Februar 2010, 3:25:50 pm', ], - ['ddd hA', 'søn 3PM'], - ['M Mo MM MMMM MMM', '2 2. 02 februar feb'], + ['ddd, hA', 'So., 3PM'], + ['M Mo MM MMMM MMM', '2 2. 02 Februar Feb.'], ['YYYY YY', '2010 10'], ['D Do DD', '14 14. 14'], - ['d do dddd ddd dd', '0 0. søndag søn sø'], + ['d do dddd ddd dd', '0 0. Sonntag So. So'], ['DDD DDDo DDDD', '45 45. 045'], ['w wo ww', '6 6. 06'], ['h hh', '3 03'], @@ -18156,16 +19863,16 @@ ['m mm', '25 25'], ['s ss', '50 50'], ['a A', 'pm PM'], - ['[den] DDDo [dag på året]', 'den 45. dag på året'], + ['[the] DDDo [day of the year]', 'the 45. day of the year'], ['LTS', '15:25:50'], ['L', '14.02.2010'], - ['LL', '14. februar 2010'], - ['LLL', '14. februar 2010 15:25'], - ['LLLL', 'søndag d. 14. februar 2010 kl. 15:25'], + ['LL', '14. Februar 2010'], + ['LLL', '14. Februar 2010 15:25'], + ['LLLL', 'Sonntag, 14. Februar 2010 15:25'], ['l', '14.2.2010'], - ['ll', '14. feb 2010'], - ['lll', '14. feb 2010 15:25'], - ['llll', 'søn d. 14. feb 2010 kl. 15:25'], + ['ll', '14. Feb. 2010'], + ['lll', '14. Feb. 2010 15:25'], + ['llll', 'So., 14. Feb. 2010 15:25'], ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -18212,7 +19919,7 @@ }); test('format month', function (assert) { - var expected = 'januar jan_februar feb_marts mar_april apr_maj maj_juni jun_juli jul_august aug_september sep_oktober okt_november nov_december dec'.split( + var expected = 'Jänner Jän._Februar Feb._März März_April Apr._Mai Mai_Juni Juni_Juli Juli_August Aug._September Sep._Oktober Okt._November Nov._Dezember Dez.'.split( '_' ), i; @@ -18226,7 +19933,7 @@ }); test('format week', function (assert) { - var expected = 'søndag søn sø_mandag man ma_tirsdag tir ti_onsdag ons on_torsdag tor to_fredag fre fr_lørdag lør lø'.split( + var expected = 'Sonntag So. So_Montag Mo. Mo_Dienstag Di. Di_Mittwoch Mi. Mi_Donnerstag Do. Do_Freitag Fr. Fr_Samstag Sa. Sa'.split( '_' ), i; @@ -18243,166 +19950,153 @@ var start = moment([2007, 1, 28]); assert.equal( start.from(moment([2007, 1, 28]).add({ s: 44 }), true), - 'få sekunder', + 'ein paar Sekunden', '44 seconds = a few seconds' ); assert.equal( start.from(moment([2007, 1, 28]).add({ s: 45 }), true), - 'et minut', + 'eine Minute', '45 seconds = a minute' ); assert.equal( start.from(moment([2007, 1, 28]).add({ s: 89 }), true), - 'et minut', + 'eine Minute', '89 seconds = a minute' ); assert.equal( start.from(moment([2007, 1, 28]).add({ s: 90 }), true), - '2 minutter', + '2 Minuten', '90 seconds = 2 minutes' ); assert.equal( start.from(moment([2007, 1, 28]).add({ m: 44 }), true), - '44 minutter', + '44 Minuten', '44 minutes = 44 minutes' ); assert.equal( start.from(moment([2007, 1, 28]).add({ m: 45 }), true), - 'en time', + 'eine Stunde', '45 minutes = an hour' ); assert.equal( start.from(moment([2007, 1, 28]).add({ m: 89 }), true), - 'en time', + 'eine Stunde', '89 minutes = an hour' ); assert.equal( start.from(moment([2007, 1, 28]).add({ m: 90 }), true), - '2 timer', + '2 Stunden', '90 minutes = 2 hours' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 5 }), true), - '5 timer', + '5 Stunden', '5 hours = 5 hours' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 21 }), true), - '21 timer', + '21 Stunden', '21 hours = 21 hours' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 22 }), true), - 'en dag', + 'ein Tag', '22 hours = a day' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 35 }), true), - 'en dag', + 'ein Tag', '35 hours = a day' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 36 }), true), - '2 dage', + '2 Tage', '36 hours = 2 days' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 1 }), true), - 'en dag', + 'ein Tag', '1 day = a day' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 5 }), true), - '5 dage', + '5 Tage', '5 days = 5 days' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 25 }), true), - '25 dage', + '25 Tage', '25 days = 25 days' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 26 }), true), - 'en måned', + 'ein Monat', '26 days = a month' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 30 }), true), - 'en måned', + 'ein Monat', '30 days = a month' ); - assert.equal( - start.from(moment([2007, 1, 28]).add({ d: 43 }), true), - 'en måned', - '43 days = a month' - ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 46 }), true), - '2 måneder', + '2 Monate', '46 days = 2 months' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 74 }), true), - '2 måneder', + '2 Monate', '75 days = 2 months' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 76 }), true), - '3 måneder', + '3 Monate', '76 days = 3 months' ); assert.equal( start.from(moment([2007, 1, 28]).add({ M: 1 }), true), - 'en måned', + 'ein Monat', '1 month = a month' ); assert.equal( start.from(moment([2007, 1, 28]).add({ M: 5 }), true), - '5 måneder', + '5 Monate', '5 months = 5 months' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 345 }), true), - 'et år', + 'ein Jahr', '345 days = a year' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 548 }), true), - '2 år', + '2 Jahre', '548 days = 2 years' ); assert.equal( start.from(moment([2007, 1, 28]).add({ y: 1 }), true), - 'et år', + 'ein Jahr', '1 year = a year' ); assert.equal( start.from(moment([2007, 1, 28]).add({ y: 5 }), true), - '5 år', + '5 Jahre', '5 years = 5 years' ); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'om få sekunder', 'prefix'); - assert.equal(moment(0).from(30000), 'få sekunder siden', 'suffix'); - }); - - test('now from now', function (assert) { - assert.equal( - moment().fromNow(), - 'få sekunder siden', - 'now from now should display as in the past' - ); + assert.equal(moment(30000).from(0), 'in ein paar Sekunden', 'prefix'); + assert.equal(moment(0).from(30000), 'vor ein paar Sekunden', 'suffix'); }); test('fromNow', function (assert) { assert.equal( moment().add({ s: 30 }).fromNow(), - 'om få sekunder', + 'in ein paar Sekunden', 'in a few seconds' ); - assert.equal(moment().add({ d: 5 }).fromNow(), 'om 5 dage', 'in 5 days'); + assert.equal(moment().add({ d: 5 }).fromNow(), 'in 5 Tagen', 'in 5 days'); }); test('calendar day', function (assert) { @@ -18410,56 +20104,55 @@ assert.equal( moment(a).calendar(), - 'i dag kl. 12:00', + 'heute um 12:00 Uhr', 'today at the same time' ); assert.equal( moment(a).add({ m: 25 }).calendar(), - 'i dag kl. 12:25', + 'heute um 12:25 Uhr', 'Now plus 25 min' ); assert.equal( moment(a).add({ h: 1 }).calendar(), - 'i dag kl. 13:00', + 'heute um 13:00 Uhr', 'Now plus 1 hour' ); assert.equal( moment(a).add({ d: 1 }).calendar(), - 'i morgen kl. 12:00', + 'morgen um 12:00 Uhr', 'tomorrow at the same time' ); assert.equal( moment(a).subtract({ h: 1 }).calendar(), - 'i dag kl. 11:00', + 'heute um 11:00 Uhr', 'Now minus 1 hour' ); assert.equal( moment(a).subtract({ d: 1 }).calendar(), - 'i går kl. 12:00', + 'gestern um 12:00 Uhr', 'yesterday at the same time' ); }); test('calendar next week', function (assert) { var i, m; - for (i = 2; i < 7; i++) { m = moment().add({ d: i }); assert.equal( m.calendar(), - m.format('på dddd [kl.] LT'), + m.format('dddd [um] LT [Uhr]'), 'Today + ' + i + ' days current time' ); m.hours(0).minutes(0).seconds(0).milliseconds(0); assert.equal( m.calendar(), - m.format('på dddd [kl.] LT'), + m.format('dddd [um] LT [Uhr]'), 'Today + ' + i + ' days beginning of day' ); m.hours(23).minutes(59).seconds(59).milliseconds(999); assert.equal( m.calendar(), - m.format('på dddd [kl.] LT'), + m.format('dddd [um] LT [Uhr]'), 'Today + ' + i + ' days end of day' ); } @@ -18467,25 +20160,24 @@ test('calendar last week', function (assert) { var i, m; - for (i = 2; i < 7; i++) { m = moment().subtract({ d: i }); assert.equal( m.calendar(), - m.format('[i] dddd[s kl.] LT'), - 'Today - ' + i + ' days current time' + m.format('[letzten] dddd [um] LT [Uhr]'), + 'Today + ' + i + ' days current time' ); m.hours(0).minutes(0).seconds(0).milliseconds(0); assert.equal( m.calendar(), - m.format('[i] dddd[s kl.] LT'), - 'Today - ' + i + ' days beginning of day' + m.format('[letzten] dddd [um] LT [Uhr]'), + 'Today + ' + i + ' days beginning of day' ); m.hours(23).minutes(59).seconds(59).milliseconds(999); assert.equal( m.calendar(), - m.format('[i] dddd[s kl.] LT'), - 'Today - ' + i + ' days end of day' + m.format('[letzten] dddd [um] LT [Uhr]'), + 'Today + ' + i + ' days end of day' ); } }); @@ -18540,6 +20232,49 @@ ); }); + test('duration humanize week threshold', function (assert) { + assert.equal( + moment.duration(1, 'week').humanize({ d: 7, w: 4 }), + 'eine Woche', + 'a week' + ); + assert.equal( + moment.duration(-1, 'week').humanize({ d: 7, w: 4 }), + 'eine Woche', + 'a week' + ); + assert.equal( + moment.duration(-1, 'week').humanize(true, { d: 7, w: 4 }), + 'vor einer Woche', + 'a week ago' + ); + assert.equal( + moment.duration(1, 'week').humanize(true, { d: 7, w: 4 }), + 'in einer Woche', + 'in a week' + ); + assert.equal( + moment.duration(2, 'week').humanize({ d: 7, w: 4 }), + '2 Wochen', + '2 weeks' + ); + assert.equal( + moment.duration(-2, 'week').humanize({ d: 7, w: 4 }), + '2 Wochen', + '2 weeks' + ); + assert.equal( + moment.duration(2, 'week').humanize(true, { d: 7, w: 4 }), + 'in 2 Wochen', + 'in 2 week' + ); + assert.equal( + moment.duration(-2, 'week').humanize(true, { d: 7, w: 4 }), + 'vor 2 Wochen', + '2 weeks ago' + ); + }); + }))); @@ -18935,14 +20670,13 @@ defineCommonLocaleTests(name); } - localeModule('de-at'); + localeModule('de-ch'); test('parse', function (assert) { - var tests = 'Jänner Jän._Februar Feb._März März_April Apr._Mai Mai_Juni Juni_Juli Juli_August Aug._September Sep._Oktober Okt._November Nov._Dezember Dez.'.split( + var tests = 'Januar Jan._Februar Feb._März März_April Apr._Mai Mai_Juni Juni_Juli Juli_August Aug._September Sep._Oktober Okt._November Nov._Dezember Dez.'.split( '_' ), i; - function equalTest(input, mmm, i) { assert.equal( moment(input, mmm).month(), @@ -18985,11 +20719,11 @@ 'dddd, Do MMMM YYYY, h:mm:ss a', 'Sonntag, 14. Februar 2010, 3:25:50 pm', ], - ['ddd, hA', 'So., 3PM'], + ['ddd, hA', 'So, 3PM'], ['M Mo MM MMMM MMM', '2 2. 02 Februar Feb.'], ['YYYY YY', '2010 10'], ['D Do DD', '14 14. 14'], - ['d do dddd ddd dd', '0 0. Sonntag So. So'], + ['d do dddd ddd dd', '0 0. Sonntag So So'], ['DDD DDDo DDDD', '45 45. 045'], ['w wo ww', '6 6. 06'], ['h hh', '3 03'], @@ -18998,6 +20732,7 @@ ['s ss', '50 50'], ['a A', 'pm PM'], ['[the] DDDo [day of the year]', 'the 45. day of the year'], + ['LT', '15:25'], ['LTS', '15:25:50'], ['L', '14.02.2010'], ['LL', '14. Februar 2010'], @@ -19006,7 +20741,7 @@ ['l', '14.2.2010'], ['ll', '14. Feb. 2010'], ['lll', '14. Feb. 2010 15:25'], - ['llll', 'So., 14. Feb. 2010 15:25'], + ['llll', 'So, 14. Feb. 2010 15:25'], ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -19053,7 +20788,7 @@ }); test('format month', function (assert) { - var expected = 'Jänner Jän._Februar Feb._März März_April Apr._Mai Mai_Juni Juni_Juli Juli_August Aug._September Sep._Oktober Okt._November Nov._Dezember Dez.'.split( + var expected = 'Januar Jan._Februar Feb._März März_April Apr._Mai Mai_Juni Juni_Juli Juli_August Aug._September Sep._Oktober Okt._November Nov._Dezember Dez.'.split( '_' ), i; @@ -19067,7 +20802,7 @@ }); test('format week', function (assert) { - var expected = 'Sonntag So. So_Montag Mo. Mo_Dienstag Di. Di_Mittwoch Mi. Mi_Donnerstag Do. Do_Freitag Fr. Fr_Samstag Sa. Sa'.split( + var expected = 'Sonntag So So_Montag Mo Mo_Dienstag Di Di_Mittwoch Mi Mi_Donnerstag Do Do_Freitag Fr Fr_Samstag Sa Sa'.split( '_' ), i; @@ -19172,6 +20907,11 @@ 'ein Monat', '30 days = a month' ); + assert.equal( + start.from(moment([2007, 1, 28]).add({ d: 43 }), true), + 'ein Monat', + '43 days = a month' + ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 46 }), true), '2 Monate', @@ -19804,7 +21544,7 @@ defineCommonLocaleTests(name); } - localeModule('de-ch'); + localeModule('de'); test('parse', function (assert) { var tests = 'Januar Jan._Februar Feb._März März_April Apr._Mai Mai_Juni Juni_Juli Juli_August Aug._September Sep._Oktober Okt._November Nov._Dezember Dez.'.split( @@ -19853,11 +21593,11 @@ 'dddd, Do MMMM YYYY, h:mm:ss a', 'Sonntag, 14. Februar 2010, 3:25:50 pm', ], - ['ddd, hA', 'So, 3PM'], + ['ddd, hA', 'So., 3PM'], ['M Mo MM MMMM MMM', '2 2. 02 Februar Feb.'], ['YYYY YY', '2010 10'], ['D Do DD', '14 14. 14'], - ['d do dddd ddd dd', '0 0. Sonntag So So'], + ['d do dddd ddd dd', '0 0. Sonntag So. So'], ['DDD DDDo DDDD', '45 45. 045'], ['w wo ww', '6 6. 06'], ['h hh', '3 03'], @@ -19866,7 +21606,6 @@ ['s ss', '50 50'], ['a A', 'pm PM'], ['[the] DDDo [day of the year]', 'the 45. day of the year'], - ['LT', '15:25'], ['LTS', '15:25:50'], ['L', '14.02.2010'], ['LL', '14. Februar 2010'], @@ -19875,7 +21614,7 @@ ['l', '14.2.2010'], ['ll', '14. Feb. 2010'], ['lll', '14. Feb. 2010 15:25'], - ['llll', 'So, 14. Feb. 2010 15:25'], + ['llll', 'So., 14. Feb. 2010 15:25'], ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -19936,7 +21675,7 @@ }); test('format week', function (assert) { - var expected = 'Sonntag So So_Montag Mo Mo_Dienstag Di Di_Mittwoch Mi Mi_Donnerstag Do Do_Freitag Fr Fr_Samstag Sa Sa'.split( + var expected = 'Sonntag So. So_Montag Mo. Mo_Dienstag Di. Di_Mittwoch Mi. Mi_Donnerstag Do. Do_Freitag Fr. Fr_Samstag Sa. Sa'.split( '_' ), i; @@ -20678,13 +22417,25 @@ defineCommonLocaleTests(name); } - localeModule('de'); + localeModule('dv'); test('parse', function (assert) { - var tests = 'Januar Jan._Februar Feb._März März_April Apr._Mai Mai_Juni Juni_Juli Juli_August Aug._September Sep._Oktober Okt._November Nov._Dezember Dez.'.split( - '_' - ), - i; + var i, + tests = [ + 'ޖެނުއަރީ', + 'ފެބްރުއަރީ', + 'މާރިޗު', + 'އޭޕްރީލު', + 'މޭ', + 'ޖޫން', + 'ޖުލައި', + 'އޯގަސްޓު', + 'ސެޕްޓެމްބަރު', + 'އޮކްޓޯބަރު', + 'ނޮވެމްބަރު', + 'ޑިސެމްބަރު', + ]; + function equalTest(input, mmm, i) { assert.equal( moment(input, mmm).month(), @@ -20702,123 +22453,89 @@ } for (i = 0; i < 12; i++) { - tests[i] = tests[i].split(' '); - equalTest(tests[i][0], 'MMM', i); - equalTest(tests[i][1], 'MMM', i); - equalTest(tests[i][0], 'MMMM', i); - equalTest(tests[i][1], 'MMMM', i); - equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i); - equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i); - equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i); - equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i); + equalTest(tests[i], 'MMM', i); + equalTest(tests[i], 'MMMM', i); + equalTest(tests[i].toLocaleLowerCase(), 'MMMM', i); + equalTest(tests[i].toLocaleUpperCase(), 'MMMM', i); - equalTestStrict(tests[i][1], 'MMM', i); - equalTestStrict(tests[i][0], 'MMMM', i); - equalTestStrict(tests[i][1].toLocaleLowerCase(), 'MMM', i); - equalTestStrict(tests[i][1].toLocaleUpperCase(), 'MMM', i); - equalTestStrict(tests[i][0].toLocaleLowerCase(), 'MMMM', i); - equalTestStrict(tests[i][0].toLocaleUpperCase(), 'MMMM', i); + equalTestStrict(tests[i], 'MMM', i); + equalTestStrict(tests[i].toLocaleUpperCase(), 'MMM', i); + equalTestStrict(tests[i].toLocaleLowerCase(), 'MMMM', i); } }); test('format', function (assert) { var a = [ [ - 'dddd, Do MMMM YYYY, h:mm:ss a', - 'Sonntag, 14. Februar 2010, 3:25:50 pm', + 'dddd, MMMM Do YYYY, h:mm:ss a', + 'އާދިއްތަ، ފެބްރުއަރީ 14 2010، 3:25:50 މފ', ], - ['ddd, hA', 'So., 3PM'], - ['M Mo MM MMMM MMM', '2 2. 02 Februar Feb.'], + ['ddd, hA', 'އާދިއްތަ، 3މފ'], + ['M Mo MM MMMM MMM', '2 2 02 ފެބްރުއަރީ ފެބްރުއަރީ'], ['YYYY YY', '2010 10'], - ['D Do DD', '14 14. 14'], - ['d do dddd ddd dd', '0 0. Sonntag So. So'], - ['DDD DDDo DDDD', '45 45. 045'], - ['w wo ww', '6 6. 06'], + ['D Do DD', '14 14 14'], + ['d do dddd ddd dd', '0 0 އާދިއްތަ އާދިއްތަ އާދި'], + ['DDD DDDo DDDD', '45 45 045'], + ['w wo ww', '8 8 08'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], - ['a A', 'pm PM'], - ['[the] DDDo [day of the year]', 'the 45. day of the year'], + ['a A', 'މފ މފ'], ['LTS', '15:25:50'], - ['L', '14.02.2010'], - ['LL', '14. Februar 2010'], - ['LLL', '14. Februar 2010 15:25'], - ['LLLL', 'Sonntag, 14. Februar 2010 15:25'], - ['l', '14.2.2010'], - ['ll', '14. Feb. 2010'], - ['lll', '14. Feb. 2010 15:25'], - ['llll', 'So., 14. Feb. 2010 15:25'], + ['L', '14/2/2010'], + ['LL', '14 ފެބްރުއަރީ 2010'], + ['LLL', '14 ފެބްރުއަރީ 2010 15:25'], + ['LLLL', 'އާދިއްތަ 14 ފެބްރުއަރީ 2010 15:25'], + ['l', '14/2/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; + for (i = 0; i < a.length; i++) { assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]); } }); - test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.'); - - assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.'); - - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.'); - - assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); - }); - test('format month', function (assert) { - var expected = 'Januar Jan._Februar Feb._März März_April Apr._Mai Mai_Juni Juni_Juli Juli_August Aug._September Sep._Oktober Okt._November Nov._Dezember Dez.'.split( - '_' - ), - i; + var i, + expected = [ + 'ޖެނުއަރީ', + 'ފެބްރުއަރީ', + 'މާރިޗު', + 'އޭޕްރީލު', + 'މޭ', + 'ޖޫން', + 'ޖުލައި', + 'އޯގަސްޓު', + 'ސެޕްޓެމްބަރު', + 'އޮކްޓޯބަރު', + 'ނޮވެމްބަރު', + 'ޑިސެމްބަރު', + ]; + for (i = 0; i < expected.length; i++) { - assert.equal( - moment([2011, i, 1]).format('MMMM MMM'), - expected[i], - expected[i] - ); + assert.equal(moment([2011, i, 1]).format('MMMM'), expected[i]); } }); test('format week', function (assert) { - var expected = 'Sonntag So. So_Montag Mo. Mo_Dienstag Di. Di_Mittwoch Mi. Mi_Donnerstag Do. Do_Freitag Fr. Fr_Samstag Sa. Sa'.split( - '_' - ), - i; + var i, + expected = [ + 'އާދިއްތަ', + 'ހޯމަ', + 'އަންގާރަ', + 'ބުދަ', + 'ބުރާސްފަތި', + 'ހުކުރު', + 'ހޮނިހިރު', + ]; + for (i = 0; i < expected.length; i++) { - assert.equal( - moment([2011, 0, 2 + i]).format('dddd ddd dd'), - expected[i], - expected[i] - ); + assert.equal(moment([2011, 0, 2 + i]).format('dddd'), expected[i]); } }); @@ -20826,158 +22543,162 @@ var start = moment([2007, 1, 28]); assert.equal( start.from(moment([2007, 1, 28]).add({ s: 44 }), true), - 'ein paar Sekunden', + 'ސިކުންތުކޮޅެއް', '44 seconds = a few seconds' ); assert.equal( start.from(moment([2007, 1, 28]).add({ s: 45 }), true), - 'eine Minute', + 'މިނިޓެއް', '45 seconds = a minute' ); assert.equal( start.from(moment([2007, 1, 28]).add({ s: 89 }), true), - 'eine Minute', + 'މިނިޓެއް', '89 seconds = a minute' ); assert.equal( start.from(moment([2007, 1, 28]).add({ s: 90 }), true), - '2 Minuten', + 'މިނިޓު 2', '90 seconds = 2 minutes' ); assert.equal( start.from(moment([2007, 1, 28]).add({ m: 44 }), true), - '44 Minuten', + 'މިނިޓު 44', '44 minutes = 44 minutes' ); assert.equal( start.from(moment([2007, 1, 28]).add({ m: 45 }), true), - 'eine Stunde', + 'ގަޑިއިރެއް', '45 minutes = an hour' ); assert.equal( start.from(moment([2007, 1, 28]).add({ m: 89 }), true), - 'eine Stunde', + 'ގަޑިއިރެއް', '89 minutes = an hour' ); assert.equal( start.from(moment([2007, 1, 28]).add({ m: 90 }), true), - '2 Stunden', + 'ގަޑިއިރު 2', '90 minutes = 2 hours' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 5 }), true), - '5 Stunden', + 'ގަޑިއިރު 5', '5 hours = 5 hours' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 21 }), true), - '21 Stunden', + 'ގަޑިއިރު 21', '21 hours = 21 hours' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 22 }), true), - 'ein Tag', + 'ދުވަހެއް', '22 hours = a day' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 35 }), true), - 'ein Tag', + 'ދުވަހެއް', '35 hours = a day' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 36 }), true), - '2 Tage', + 'ދުވަސް 2', '36 hours = 2 days' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 1 }), true), - 'ein Tag', + 'ދުވަހެއް', '1 day = a day' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 5 }), true), - '5 Tage', + 'ދުވަސް 5', '5 days = 5 days' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 25 }), true), - '25 Tage', + 'ދުވަސް 25', '25 days = 25 days' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 26 }), true), - 'ein Monat', + 'މަހެއް', '26 days = a month' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 30 }), true), - 'ein Monat', + 'މަހެއް', '30 days = a month' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 43 }), true), - 'ein Monat', + 'މަހެއް', '43 days = a month' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 46 }), true), - '2 Monate', + 'މަސް 2', '46 days = 2 months' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 74 }), true), - '2 Monate', + 'މަސް 2', '75 days = 2 months' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 76 }), true), - '3 Monate', + 'މަސް 3', '76 days = 3 months' ); assert.equal( start.from(moment([2007, 1, 28]).add({ M: 1 }), true), - 'ein Monat', + 'މަހެއް', '1 month = a month' ); assert.equal( start.from(moment([2007, 1, 28]).add({ M: 5 }), true), - '5 Monate', + 'މަސް 5', '5 months = 5 months' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 345 }), true), - 'ein Jahr', + 'އަހަރެއް', '345 days = a year' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 548 }), true), - '2 Jahre', + 'އަހަރު 2', '548 days = 2 years' ); assert.equal( start.from(moment([2007, 1, 28]).add({ y: 1 }), true), - 'ein Jahr', + 'އަހަރެއް', '1 year = a year' ); assert.equal( start.from(moment([2007, 1, 28]).add({ y: 5 }), true), - '5 Jahre', + 'އަހަރު 5', '5 years = 5 years' ); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'in ein paar Sekunden', 'prefix'); - assert.equal(moment(0).from(30000), 'vor ein paar Sekunden', 'suffix'); + assert.equal(moment(30000).from(0), 'ތެރޭގައި ސިކުންތުކޮޅެއް', 'prefix'); + assert.equal(moment(0).from(30000), 'ކުރިން ސިކުންތުކޮޅެއް', 'suffix'); }); test('fromNow', function (assert) { assert.equal( moment().add({ s: 30 }).fromNow(), - 'in ein paar Sekunden', + 'ތެރޭގައި ސިކުންތުކޮޅެއް', 'in a few seconds' ); - assert.equal(moment().add({ d: 5 }).fromNow(), 'in 5 Tagen', 'in 5 days'); + assert.equal( + moment().add({ d: 5 }).fromNow(), + 'ތެރޭގައި ދުވަސް 5', + 'in 5 days' + ); }); test('calendar day', function (assert) { @@ -20985,32 +22706,32 @@ assert.equal( moment(a).calendar(), - 'heute um 12:00 Uhr', + 'މިއަދު 12:00', 'today at the same time' ); assert.equal( moment(a).add({ m: 25 }).calendar(), - 'heute um 12:25 Uhr', + 'މިއަދު 12:25', 'Now plus 25 min' ); assert.equal( moment(a).add({ h: 1 }).calendar(), - 'heute um 13:00 Uhr', + 'މިއަދު 13:00', 'Now plus 1 hour' ); assert.equal( moment(a).add({ d: 1 }).calendar(), - 'morgen um 12:00 Uhr', + 'މާދަމާ 12:00', 'tomorrow at the same time' ); assert.equal( moment(a).subtract({ h: 1 }).calendar(), - 'heute um 11:00 Uhr', + 'މިއަދު 11:00', 'Now minus 1 hour' ); assert.equal( moment(a).subtract({ d: 1 }).calendar(), - 'gestern um 12:00 Uhr', + 'އިއްޔެ 12:00', 'yesterday at the same time' ); }); @@ -21021,19 +22742,19 @@ m = moment().add({ d: i }); assert.equal( m.calendar(), - m.format('dddd [um] LT [Uhr]'), + m.format('dddd LT'), 'Today + ' + i + ' days current time' ); m.hours(0).minutes(0).seconds(0).milliseconds(0); assert.equal( m.calendar(), - m.format('dddd [um] LT [Uhr]'), + m.format('dddd LT'), 'Today + ' + i + ' days beginning of day' ); m.hours(23).minutes(59).seconds(59).milliseconds(999); assert.equal( m.calendar(), - m.format('dddd [um] LT [Uhr]'), + m.format('dddd LT'), 'Today + ' + i + ' days end of day' ); } @@ -21045,19 +22766,19 @@ m = moment().subtract({ d: i }); assert.equal( m.calendar(), - m.format('[letzten] dddd [um] LT [Uhr]'), + m.format('[ފާއިތުވި] dddd LT'), 'Today + ' + i + ' days current time' ); m.hours(0).minutes(0).seconds(0).milliseconds(0); assert.equal( m.calendar(), - m.format('[letzten] dddd [um] LT [Uhr]'), + m.format('[ފާއިތުވި] dddd LT'), 'Today + ' + i + ' days beginning of day' ); m.hours(23).minutes(59).seconds(59).milliseconds(999); assert.equal( m.calendar(), - m.format('[letzten] dddd [um] LT [Uhr]'), + m.format('[ފާއިތުވި] dddd LT'), 'Today + ' + i + ' days end of day' ); } @@ -21088,71 +22809,28 @@ test('weeks year starting sunday formatted', function (assert) { assert.equal( moment([2012, 0, 1]).format('w ww wo'), - '52 52 52.', - 'Jan 1 2012 should be week 52' + '1 01 1', + 'Jan 1 2012 should be week 1' ); assert.equal( moment([2012, 0, 2]).format('w ww wo'), - '1 01 1.', + '1 01 1', 'Jan 2 2012 should be week 1' ); assert.equal( moment([2012, 0, 8]).format('w ww wo'), - '1 01 1.', - 'Jan 8 2012 should be week 1' + '2 02 2', + 'Jan 8 2012 should be week 2' ); assert.equal( moment([2012, 0, 9]).format('w ww wo'), - '2 02 2.', + '2 02 2', 'Jan 9 2012 should be week 2' ); assert.equal( moment([2012, 0, 15]).format('w ww wo'), - '2 02 2.', - 'Jan 15 2012 should be week 2' - ); - }); - - test('duration humanize week threshold', function (assert) { - assert.equal( - moment.duration(1, 'week').humanize({ d: 7, w: 4 }), - 'eine Woche', - 'a week' - ); - assert.equal( - moment.duration(-1, 'week').humanize({ d: 7, w: 4 }), - 'eine Woche', - 'a week' - ); - assert.equal( - moment.duration(-1, 'week').humanize(true, { d: 7, w: 4 }), - 'vor einer Woche', - 'a week ago' - ); - assert.equal( - moment.duration(1, 'week').humanize(true, { d: 7, w: 4 }), - 'in einer Woche', - 'in a week' - ); - assert.equal( - moment.duration(2, 'week').humanize({ d: 7, w: 4 }), - '2 Wochen', - '2 weeks' - ); - assert.equal( - moment.duration(-2, 'week').humanize({ d: 7, w: 4 }), - '2 Wochen', - '2 weeks' - ); - assert.equal( - moment.duration(2, 'week').humanize(true, { d: 7, w: 4 }), - 'in 2 Wochen', - 'in 2 week' - ); - assert.equal( - moment.duration(-2, 'week').humanize(true, { d: 7, w: 4 }), - 'vor 2 Wochen', - '2 weeks ago' + '3 03 3', + 'Jan 15 2012 should be week 3' ); }); @@ -21551,24 +23229,13 @@ defineCommonLocaleTests(name); } - localeModule('dv'); + localeModule('el'); test('parse', function (assert) { var i, - tests = [ - 'ޖެނުއަރީ', - 'ފެބްރުއަރީ', - 'މާރިޗު', - 'އޭޕްރީލު', - 'މޭ', - 'ޖޫން', - 'ޖުލައި', - 'އޯގަސްޓު', - 'ސެޕްޓެމްބަރު', - 'އޮކްޓޯބަރު', - 'ނޮވެމްބަރު', - 'ޑިސެމްބަރު', - ]; + tests = 'Ιανουάριος Ιαν_Φεβρουάριος Φεβ_Μάρτιος Μαρ_Απρίλιος Απρ_Μάιος Μαϊ_Ιούνιος Ιουν_Ιούλιος Ιουλ_Αύγουστος Αυγ_Σεπτέμβριος Σεπ_Οκτώβριος Οκτ_Νοέμβριος Νοε_Δεκέμβριος Δεκ'.split( + '_' + ); function equalTest(input, mmm, i) { assert.equal( @@ -21587,14 +23254,80 @@ } for (i = 0; i < 12; i++) { - equalTest(tests[i], 'MMM', i); - equalTest(tests[i], 'MMMM', i); - equalTest(tests[i].toLocaleLowerCase(), 'MMMM', i); - equalTest(tests[i].toLocaleUpperCase(), 'MMMM', i); + tests[i] = tests[i].split(' '); + equalTest(tests[i][0], 'MMM', i); + equalTest(tests[i][1], 'MMM', i); + equalTest(tests[i][0], 'MMMM', i); + equalTest(tests[i][1], 'MMMM', i); + equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i); + equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i); + equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i); + equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i); - equalTestStrict(tests[i], 'MMM', i); - equalTestStrict(tests[i].toLocaleUpperCase(), 'MMM', i); - equalTestStrict(tests[i].toLocaleLowerCase(), 'MMMM', i); + equalTestStrict(tests[i][1], 'MMM', i); + equalTestStrict(tests[i][0], 'MMMM', i); + equalTestStrict(tests[i][1].toLocaleLowerCase(), 'MMM', i); + equalTestStrict(tests[i][1].toLocaleUpperCase(), 'MMM', i); + equalTestStrict(tests[i][0].toLocaleLowerCase(), 'MMMM', i); + equalTestStrict(tests[i][0].toLocaleUpperCase(), 'MMMM', i); + } + }); + + test('parse meridiem', function (assert) { + var i, + b = moment(), + meridiemTests = [ + // h a patterns, expected hours, isValid + ['10 πμ', 10, true], + ['10 μμ', 22, true], + ['10 π.μ.', 10, true], + ['10 μ.μ.', 22, true], + ['10 π', 10, true], + ['10 μ', 22, true], + ['10 ΠΜ', 10, true], + ['10 ΜΜ', 22, true], + ['10 Π.Μ.', 10, true], + ['10 Μ.Μ.', 22, true], + ['10 Π', 10, true], + ['10 Μ', 22, true], + ['10 am', 10, false], + ['10 pm', 10, false], + ], + parsed; + + // test that a formatted moment including meridiem string can be parsed back to the same moment + assert.ok( + b.isSame( + moment(b.format('h:mm:ss a'), 'h:mm:ss a', 'el', true), + 'seconds' + ), + b.format('h:mm:ss a') + + ' should be equal to ' + + moment(b.format('h:mm:ss a'), 'h:mm:ss a', 'el', true).format( + 'h:mm:ss a' + ) + ); + + // test that a formatted moment having a meridiem string can be parsed with strict flag + assert.ok( + moment(b.format('h:mm:ss a'), 'h:mm:ss a', 'el', true).isValid(), + b.format('h:mm:ss a') + ' should be parsed as valid' + ); + + for (i = 0; i < meridiemTests.length; i++) { + parsed = moment(meridiemTests[i][0], 'h a', 'el', true); + assert.equal( + parsed.isValid(), + meridiemTests[i][2], + 'validity for ' + meridiemTests[i][0] + ); + if (parsed.isValid()) { + assert.equal( + parsed.hours(), + meridiemTests[i][1], + 'hours for ' + meridiemTests[i][0] + ); + } } }); @@ -21602,29 +23335,35 @@ var a = [ [ 'dddd, MMMM Do YYYY, h:mm:ss a', - 'އާދިއްތަ، ފެބްރުއަރީ 14 2010، 3:25:50 މފ', + 'Κυριακή, Φεβρουάριος 14η 2010, 3:25:50 μμ', ], - ['ddd, hA', 'އާދިއްތަ، 3މފ'], - ['M Mo MM MMMM MMM', '2 2 02 ފެބްރުއަރީ ފެބްރުއަރީ'], + [ + 'dddd, D MMMM YYYY, h:mm:ss a', + 'Κυριακή, 14 Φεβρουαρίου 2010, 3:25:50 μμ', + ], + ['ddd, hA', 'Κυρ, 3ΜΜ'], + ['dddd, MMMM YYYY', 'Κυριακή, Φεβρουάριος 2010'], + ['M Mo MM MMMM MMM', '2 2η 02 Φεβρουάριος Φεβ'], ['YYYY YY', '2010 10'], - ['D Do DD', '14 14 14'], - ['d do dddd ddd dd', '0 0 އާދިއްތަ އާދިއްތަ އާދި'], - ['DDD DDDo DDDD', '45 45 045'], - ['w wo ww', '8 8 08'], + ['D Do DD', '14 14η 14'], + ['d do dddd ddd dd', '0 0η Κυριακή Κυρ Κυ'], + ['DDD DDDo DDDD', '45 45η 045'], + ['w wo ww', '6 6η 06'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], - ['a A', 'މފ މފ'], - ['LTS', '15:25:50'], - ['L', '14/2/2010'], - ['LL', '14 ފެބްރުއަރީ 2010'], - ['LLL', '14 ފެބްރުއަރީ 2010 15:25'], - ['LLLL', 'އާދިއްތަ 14 ފެބްރުއަރީ 2010 15:25'], + ['a A', 'μμ ΜΜ'], + ['[the] DDDo [day of the year]', 'the 45η day of the year'], + ['LTS', '3:25:50 ΜΜ'], + ['L', '14/02/2010'], + ['LL', '14 Φεβρουαρίου 2010'], + ['LLL', '14 Φεβρουαρίου 2010 3:25 ΜΜ'], + ['LLLL', 'Κυριακή, 14 Φεβρουαρίου 2010 3:25 ΜΜ'], ['l', '14/2/2010'], - ['ll', '14 ފެބްރުއަރީ 2010'], - ['lll', '14 ފެބްރުއަރީ 2010 15:25'], - ['llll', 'އާދިއްތަ 14 ފެބްރުއަރީ 2010 15:25'], + ['ll', '14 Φεβ 2010'], + ['lll', '14 Φεβ 2010 3:25 ΜΜ'], + ['llll', 'Κυρ, 14 Φεβ 2010 3:25 ΜΜ'], ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -21634,205 +23373,238 @@ } }); + test('format ordinal', function (assert) { + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1η', '1η'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2η', '2η'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3η', '3η'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4η', '4η'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5η', '5η'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6η', '6η'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7η', '7η'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8η', '8η'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9η', '9η'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10η', '10η'); + + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11η', '11η'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12η', '12η'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13η', '13η'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14η', '14η'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15η', '15η'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16η', '16η'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17η', '17η'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18η', '18η'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19η', '19η'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20η', '20η'); + + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21η', '21η'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22η', '22η'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23η', '23η'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24η', '24η'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25η', '25η'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26η', '26η'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27η', '27η'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28η', '28η'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29η', '29η'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30η', '30η'); + + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31η', '31η'); + }); + test('format month', function (assert) { var i, - expected = [ - 'ޖެނުއަރީ', - 'ފެބްރުއަރީ', - 'މާރިޗު', - 'އޭޕްރީލު', - 'މޭ', - 'ޖޫން', - 'ޖުލައި', - 'އޯގަސްޓު', - 'ސެޕްޓެމްބަރު', - 'އޮކްޓޯބަރު', - 'ނޮވެމްބަރު', - 'ޑިސެމްބަރު', - ]; + expected = 'Ιανουάριος Ιαν_Φεβρουάριος Φεβ_Μάρτιος Μαρ_Απρίλιος Απρ_Μάιος Μαϊ_Ιούνιος Ιουν_Ιούλιος Ιουλ_Αύγουστος Αυγ_Σεπτέμβριος Σεπ_Οκτώβριος Οκτ_Νοέμβριος Νοε_Δεκέμβριος Δεκ'.split( + '_' + ); for (i = 0; i < expected.length; i++) { - assert.equal(moment([2011, i, 1]).format('MMMM'), expected[i]); + assert.equal( + moment([2011, i, 1]).format('MMMM MMM'), + expected[i], + expected[i] + ); } }); test('format week', function (assert) { var i, - expected = [ - 'އާދިއްތަ', - 'ހޯމަ', - 'އަންގާރަ', - 'ބުދަ', - 'ބުރާސްފަތި', - 'ހުކުރު', - 'ހޮނިހިރު', - ]; + expected = 'Κυριακή Κυρ Κυ_Δευτέρα Δευ Δε_Τρίτη Τρι Τρ_Τετάρτη Τετ Τε_Πέμπτη Πεμ Πε_Παρασκευή Παρ Πα_Σάββατο Σαβ Σα'.split( + '_' + ); for (i = 0; i < expected.length; i++) { - assert.equal(moment([2011, 0, 2 + i]).format('dddd'), expected[i]); + assert.equal( + moment([2011, 0, 2 + i]).format('dddd ddd dd'), + expected[i], + expected[i] + ); } }); test('from', function (assert) { var start = moment([2007, 1, 28]); + assert.equal( start.from(moment([2007, 1, 28]).add({ s: 44 }), true), - 'ސިކުންތުކޮޅެއް', + 'λίγα δευτερόλεπτα', '44 seconds = a few seconds' ); assert.equal( start.from(moment([2007, 1, 28]).add({ s: 45 }), true), - 'މިނިޓެއް', + 'ένα λεπτό', '45 seconds = a minute' ); assert.equal( start.from(moment([2007, 1, 28]).add({ s: 89 }), true), - 'މިނިޓެއް', + 'ένα λεπτό', '89 seconds = a minute' ); assert.equal( start.from(moment([2007, 1, 28]).add({ s: 90 }), true), - 'މިނިޓު 2', + '2 λεπτά', '90 seconds = 2 minutes' ); assert.equal( start.from(moment([2007, 1, 28]).add({ m: 44 }), true), - 'މިނިޓު 44', + '44 λεπτά', '44 minutes = 44 minutes' ); assert.equal( start.from(moment([2007, 1, 28]).add({ m: 45 }), true), - 'ގަޑިއިރެއް', + 'μία ώρα', '45 minutes = an hour' ); assert.equal( start.from(moment([2007, 1, 28]).add({ m: 89 }), true), - 'ގަޑިއިރެއް', + 'μία ώρα', '89 minutes = an hour' ); assert.equal( start.from(moment([2007, 1, 28]).add({ m: 90 }), true), - 'ގަޑިއިރު 2', + '2 ώρες', '90 minutes = 2 hours' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 5 }), true), - 'ގަޑިއިރު 5', + '5 ώρες', '5 hours = 5 hours' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 21 }), true), - 'ގަޑިއިރު 21', + '21 ώρες', '21 hours = 21 hours' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 22 }), true), - 'ދުވަހެއް', + 'μία μέρα', '22 hours = a day' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 35 }), true), - 'ދުވަހެއް', + 'μία μέρα', '35 hours = a day' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 36 }), true), - 'ދުވަސް 2', + '2 μέρες', '36 hours = 2 days' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 1 }), true), - 'ދުވަހެއް', + 'μία μέρα', '1 day = a day' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 5 }), true), - 'ދުވަސް 5', + '5 μέρες', '5 days = 5 days' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 25 }), true), - 'ދުވަސް 25', + '25 μέρες', '25 days = 25 days' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 26 }), true), - 'މަހެއް', + 'ένας μήνας', '26 days = a month' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 30 }), true), - 'މަހެއް', + 'ένας μήνας', '30 days = a month' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 43 }), true), - 'މަހެއް', + 'ένας μήνας', '43 days = a month' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 46 }), true), - 'މަސް 2', + '2 μήνες', '46 days = 2 months' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 74 }), true), - 'މަސް 2', + '2 μήνες', '75 days = 2 months' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 76 }), true), - 'މަސް 3', + '3 μήνες', '76 days = 3 months' ); assert.equal( start.from(moment([2007, 1, 28]).add({ M: 1 }), true), - 'މަހެއް', + 'ένας μήνας', '1 month = a month' ); assert.equal( start.from(moment([2007, 1, 28]).add({ M: 5 }), true), - 'މަސް 5', + '5 μήνες', '5 months = 5 months' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 345 }), true), - 'އަހަރެއް', + 'ένας χρόνος', '345 days = a year' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 548 }), true), - 'އަހަރު 2', + '2 χρόνια', '548 days = 2 years' ); assert.equal( start.from(moment([2007, 1, 28]).add({ y: 1 }), true), - 'އަހަރެއް', + 'ένας χρόνος', '1 year = a year' ); assert.equal( start.from(moment([2007, 1, 28]).add({ y: 5 }), true), - 'އަހަރު 5', + '5 χρόνια', '5 years = 5 years' ); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'ތެރޭގައި ސިކުންތުކޮޅެއް', 'prefix'); - assert.equal(moment(0).from(30000), 'ކުރިން ސިކުންތުކޮޅެއް', 'suffix'); + assert.equal(moment(30000).from(0), 'σε λίγα δευτερόλεπτα', 'prefix'); + assert.equal(moment(0).from(30000), 'λίγα δευτερόλεπτα πριν', 'suffix'); + }); + + test('now from now', function (assert) { + assert.equal( + moment().fromNow(), + 'λίγα δευτερόλεπτα πριν', + 'now from now should display as in the past' + ); }); test('fromNow', function (assert) { assert.equal( moment().add({ s: 30 }).fromNow(), - 'ތެރޭގައި ސިކުންތުކޮޅެއް', + 'σε λίγα δευτερόλεπτα', 'in a few seconds' ); - assert.equal( - moment().add({ d: 5 }).fromNow(), - 'ތެރޭގައި ދުވަސް 5', - 'in 5 days' - ); + assert.equal(moment().add({ d: 5 }).fromNow(), 'σε 5 μέρες', 'in 5 days'); }); test('calendar day', function (assert) { @@ -21840,32 +23612,32 @@ assert.equal( moment(a).calendar(), - 'މިއަދު 12:00', + 'Σήμερα στις 12:00 ΜΜ', 'today at the same time' ); assert.equal( moment(a).add({ m: 25 }).calendar(), - 'މިއަދު 12:25', + 'Σήμερα στις 12:25 ΜΜ', 'Now plus 25 min' ); assert.equal( moment(a).add({ h: 1 }).calendar(), - 'މިއަދު 13:00', + 'Σήμερα στη 1:00 ΜΜ', 'Now plus 1 hour' ); assert.equal( moment(a).add({ d: 1 }).calendar(), - 'މާދަމާ 12:00', + 'Αύριο στις 12:00 ΜΜ', 'tomorrow at the same time' ); assert.equal( moment(a).subtract({ h: 1 }).calendar(), - 'މިއަދު 11:00', + 'Σήμερα στις 11:00 ΠΜ', 'Now minus 1 hour' ); assert.equal( moment(a).subtract({ d: 1 }).calendar(), - 'އިއްޔެ 12:00', + 'Χθες στις 12:00 ΜΜ', 'yesterday at the same time' ); }); @@ -21876,44 +23648,61 @@ m = moment().add({ d: i }); assert.equal( m.calendar(), - m.format('dddd LT'), + m.format( + 'dddd [' + (m.hours() % 12 === 1 ? 'στη' : 'στις') + '] LT' + ), 'Today + ' + i + ' days current time' ); m.hours(0).minutes(0).seconds(0).milliseconds(0); assert.equal( m.calendar(), - m.format('dddd LT'), + m.format('dddd [στις] LT'), 'Today + ' + i + ' days beginning of day' ); m.hours(23).minutes(59).seconds(59).milliseconds(999); assert.equal( m.calendar(), - m.format('dddd LT'), + m.format('dddd [στις] LT'), 'Today + ' + i + ' days end of day' ); } }); test('calendar last week', function (assert) { - var i, m; + var i, m, dayString; for (i = 2; i < 7; i++) { m = moment().subtract({ d: i }); + dayString = + m.day() === 6 + ? '[το προηγούμενο Σάββατο]' + : '[την προηγούμενη] dddd'; assert.equal( m.calendar(), - m.format('[ފާއިތުވި] dddd LT'), - 'Today + ' + i + ' days current time' + m.format( + dayString + + ' [' + + (m.hours() % 12 === 1 ? 'στη' : 'στις') + + '] LT' + ), + 'Today - ' + i + ' days current time' + ); + m.hours(1).minutes(30).seconds(0).milliseconds(0); + assert.equal( + m.calendar(), + m.format(dayString + ' [στη] LT'), + 'Today - ' + i + ' days one o clock' ); m.hours(0).minutes(0).seconds(0).milliseconds(0); assert.equal( m.calendar(), - m.format('[ފާއިތުވި] dddd LT'), - 'Today + ' + i + ' days beginning of day' + m.format(dayString + ' [στις] LT'), + 'Today - ' + i + ' days beginning of day' ); m.hours(23).minutes(59).seconds(59).milliseconds(999); assert.equal( m.calendar(), - m.format('[ފާއިތުވި] dddd LT'), - 'Today + ' + i + ' days end of day' + m.format(dayString + ' [στις] LT'), + 'Today - ' + i + ' days end of day' ); } }); @@ -21940,31 +23729,45 @@ ); }); - test('weeks year starting sunday formatted', function (assert) { + test('weeks year starting sunday format', function (assert) { assert.equal( moment([2012, 0, 1]).format('w ww wo'), - '1 01 1', - 'Jan 1 2012 should be week 1' + '52 52 52η', + 'Jan 1 2012 should be week 52' ); assert.equal( - moment([2012, 0, 2]).format('w ww wo'), - '1 01 1', - 'Jan 2 2012 should be week 1' + moment([2012, 0, 7]).format('w ww wo'), + '1 01 1η', + 'Jan 7 2012 should be week 1' ); assert.equal( moment([2012, 0, 8]).format('w ww wo'), - '2 02 2', - 'Jan 8 2012 should be week 2' + '1 01 1η', + 'Jan 8 2012 should be week 1' ); assert.equal( - moment([2012, 0, 9]).format('w ww wo'), - '2 02 2', - 'Jan 9 2012 should be week 2' + moment([2012, 0, 14]).format('w ww wo'), + '2 02 2η', + 'Jan 14 2012 should be week 2' ); assert.equal( moment([2012, 0, 15]).format('w ww wo'), - '3 03 3', - 'Jan 15 2012 should be week 3' + '2 02 2η', + 'Jan 15 2012 should be week 2' + ); + }); + + test('localeData months calls', function (assert) { + var jan = moment('2012-01-01'); + assert.equal( + moment.localeData().months(jan), + 'Ιανουάριος', + 'should return the nominative month name' + ); + assert.equal( + moment.localeData().months(jan, 'D MMMM'), + 'Ιανουαρίου', + 'should return the genitive month name' ); }); @@ -22363,14 +24166,13 @@ defineCommonLocaleTests(name); } - localeModule('el'); + localeModule('en-au'); test('parse', function (assert) { - var i, - tests = 'Ιανουάριος Ιαν_Φεβρουάριος Φεβ_Μάρτιος Μαρ_Απρίλιος Απρ_Μάιος Μαϊ_Ιούνιος Ιουν_Ιούλιος Ιουλ_Αύγουστος Αυγ_Σεπτέμβριος Σεπ_Οκτώβριος Οκτ_Νοέμβριος Νοε_Δεκέμβριος Δεκ'.split( + var tests = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split( '_' - ); - + ), + i; function equalTest(input, mmm, i) { assert.equal( moment(input, mmm).month(), @@ -22407,149 +24209,84 @@ } }); - test('parse meridiem', function (assert) { - var i, - b = moment(), - meridiemTests = [ - // h a patterns, expected hours, isValid - ['10 πμ', 10, true], - ['10 μμ', 22, true], - ['10 π.μ.', 10, true], - ['10 μ.μ.', 22, true], - ['10 π', 10, true], - ['10 μ', 22, true], - ['10 ΠΜ', 10, true], - ['10 ΜΜ', 22, true], - ['10 Π.Μ.', 10, true], - ['10 Μ.Μ.', 22, true], - ['10 Π', 10, true], - ['10 Μ', 22, true], - ['10 am', 10, false], - ['10 pm', 10, false], - ], - parsed; - - // test that a formatted moment including meridiem string can be parsed back to the same moment - assert.ok( - b.isSame( - moment(b.format('h:mm:ss a'), 'h:mm:ss a', 'el', true), - 'seconds' - ), - b.format('h:mm:ss a') + - ' should be equal to ' + - moment(b.format('h:mm:ss a'), 'h:mm:ss a', 'el', true).format( - 'h:mm:ss a' - ) - ); - - // test that a formatted moment having a meridiem string can be parsed with strict flag - assert.ok( - moment(b.format('h:mm:ss a'), 'h:mm:ss a', 'el', true).isValid(), - b.format('h:mm:ss a') + ' should be parsed as valid' - ); - - for (i = 0; i < meridiemTests.length; i++) { - parsed = moment(meridiemTests[i][0], 'h a', 'el', true); - assert.equal( - parsed.isValid(), - meridiemTests[i][2], - 'validity for ' + meridiemTests[i][0] - ); - if (parsed.isValid()) { - assert.equal( - parsed.hours(), - meridiemTests[i][1], - 'hours for ' + meridiemTests[i][0] - ); - } - } - }); - test('format', function (assert) { var a = [ [ 'dddd, MMMM Do YYYY, h:mm:ss a', - 'Κυριακή, Φεβρουάριος 14η 2010, 3:25:50 μμ', - ], - [ - 'dddd, D MMMM YYYY, h:mm:ss a', - 'Κυριακή, 14 Φεβρουαρίου 2010, 3:25:50 μμ', + 'Sunday, February 14th 2010, 3:25:50 pm', ], - ['ddd, hA', 'Κυρ, 3ΜΜ'], - ['dddd, MMMM YYYY', 'Κυριακή, Φεβρουάριος 2010'], - ['M Mo MM MMMM MMM', '2 2η 02 Φεβρουάριος Φεβ'], + ['ddd, hA', 'Sun, 3PM'], + ['M Mo MM MMMM MMM', '2 2nd 02 February Feb'], ['YYYY YY', '2010 10'], - ['D Do DD', '14 14η 14'], - ['d do dddd ddd dd', '0 0η Κυριακή Κυρ Κυ'], - ['DDD DDDo DDDD', '45 45η 045'], - ['w wo ww', '6 6η 06'], + ['D Do DD', '14 14th 14'], + ['d do dddd ddd dd', '0 0th Sunday Sun Su'], + ['DDD DDDo DDDD', '45 45th 045'], + ['w wo ww', '7 7th 07'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], - ['a A', 'μμ ΜΜ'], - ['[the] DDDo [day of the year]', 'the 45η day of the year'], - ['LTS', '3:25:50 ΜΜ'], + ['a A', 'pm PM'], + ['[the] DDDo [day of the year]', 'the 45th day of the year'], + ['LTS', '3:25:50 PM'], ['L', '14/02/2010'], - ['LL', '14 Φεβρουαρίου 2010'], - ['LLL', '14 Φεβρουαρίου 2010 3:25 ΜΜ'], - ['LLLL', 'Κυριακή, 14 Φεβρουαρίου 2010 3:25 ΜΜ'], + ['LL', '14 February 2010'], + ['LLL', '14 February 2010 3:25 PM'], + ['LLLL', 'Sunday, 14 February 2010 3:25 PM'], ['l', '14/2/2010'], - ['ll', '14 Φεβ 2010'], - ['lll', '14 Φεβ 2010 3:25 ΜΜ'], - ['llll', 'Κυρ, 14 Φεβ 2010 3:25 ΜΜ'], + ['ll', '14 Feb 2010'], + ['lll', '14 Feb 2010 3:25 PM'], + ['llll', 'Sun, 14 Feb 2010 3:25 PM'], ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; - for (i = 0; i < a.length; i++) { assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]); } }); test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1η', '1η'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '2η', '2η'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '3η', '3η'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '4η', '4η'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '5η', '5η'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '6η', '6η'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '7η', '7η'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '8η', '8η'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '9η', '9η'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '10η', '10η'); + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1st', '1st'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2nd', '2nd'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3rd', '3rd'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4th', '4th'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5th', '5th'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6th', '6th'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7th', '7th'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8th', '8th'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9th', '9th'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10th', '10th'); - assert.equal(moment([2011, 0, 11]).format('DDDo'), '11η', '11η'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '12η', '12η'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '13η', '13η'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '14η', '14η'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '15η', '15η'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '16η', '16η'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '17η', '17η'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '18η', '18η'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '19η', '19η'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '20η', '20η'); + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11th', '11th'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12th', '12th'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13th', '13th'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14th', '14th'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15th', '15th'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16th', '16th'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17th', '17th'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18th', '18th'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19th', '19th'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20th', '20th'); - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21η', '21η'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22η', '22η'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23η', '23η'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24η', '24η'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25η', '25η'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26η', '26η'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27η', '27η'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28η', '28η'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29η', '29η'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30η', '30η'); + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21st', '21st'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22nd', '22nd'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23rd', '23rd'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24th', '24th'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25th', '25th'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26th', '26th'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27th', '27th'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28th', '28th'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29th', '29th'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30th', '30th'); - assert.equal(moment([2011, 0, 31]).format('DDDo'), '31η', '31η'); + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31st', '31st'); }); test('format month', function (assert) { - var i, - expected = 'Ιανουάριος Ιαν_Φεβρουάριος Φεβ_Μάρτιος Μαρ_Απρίλιος Απρ_Μάιος Μαϊ_Ιούνιος Ιουν_Ιούλιος Ιουλ_Αύγουστος Αυγ_Σεπτέμβριος Σεπ_Οκτώβριος Οκτ_Νοέμβριος Νοε_Δεκέμβριος Δεκ'.split( + var expected = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split( '_' - ); - + ), + i; for (i = 0; i < expected.length; i++) { assert.equal( moment([2011, i, 1]).format('MMMM MMM'), @@ -22560,11 +24297,10 @@ }); test('format week', function (assert) { - var i, - expected = 'Κυριακή Κυρ Κυ_Δευτέρα Δευ Δε_Τρίτη Τρι Τρ_Τετάρτη Τετ Τε_Πέμπτη Πεμ Πε_Παρασκευή Παρ Πα_Σάββατο Σαβ Σα'.split( + var expected = 'Sunday Sun Su_Monday Mon Mo_Tuesday Tue Tu_Wednesday Wed We_Thursday Thu Th_Friday Fri Fr_Saturday Sat Sa'.split( '_' - ); - + ), + i; for (i = 0; i < expected.length; i++) { assert.equal( moment([2011, 0, 2 + i]).format('dddd ddd dd'), @@ -22576,158 +24312,157 @@ test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal( start.from(moment([2007, 1, 28]).add({ s: 44 }), true), - 'λίγα δευτερόλεπτα', + 'a few seconds', '44 seconds = a few seconds' ); assert.equal( start.from(moment([2007, 1, 28]).add({ s: 45 }), true), - 'ένα λεπτό', + 'a minute', '45 seconds = a minute' ); assert.equal( start.from(moment([2007, 1, 28]).add({ s: 89 }), true), - 'ένα λεπτό', + 'a minute', '89 seconds = a minute' ); assert.equal( start.from(moment([2007, 1, 28]).add({ s: 90 }), true), - '2 λεπτά', + '2 minutes', '90 seconds = 2 minutes' ); assert.equal( start.from(moment([2007, 1, 28]).add({ m: 44 }), true), - '44 λεπτά', + '44 minutes', '44 minutes = 44 minutes' ); assert.equal( start.from(moment([2007, 1, 28]).add({ m: 45 }), true), - 'μία ώρα', + 'an hour', '45 minutes = an hour' ); assert.equal( start.from(moment([2007, 1, 28]).add({ m: 89 }), true), - 'μία ώρα', + 'an hour', '89 minutes = an hour' ); assert.equal( start.from(moment([2007, 1, 28]).add({ m: 90 }), true), - '2 ώρες', + '2 hours', '90 minutes = 2 hours' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 5 }), true), - '5 ώρες', + '5 hours', '5 hours = 5 hours' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 21 }), true), - '21 ώρες', + '21 hours', '21 hours = 21 hours' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 22 }), true), - 'μία μέρα', + 'a day', '22 hours = a day' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 35 }), true), - 'μία μέρα', + 'a day', '35 hours = a day' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 36 }), true), - '2 μέρες', + '2 days', '36 hours = 2 days' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 1 }), true), - 'μία μέρα', + 'a day', '1 day = a day' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 5 }), true), - '5 μέρες', + '5 days', '5 days = 5 days' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 25 }), true), - '25 μέρες', + '25 days', '25 days = 25 days' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 26 }), true), - 'ένας μήνας', + 'a month', '26 days = a month' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 30 }), true), - 'ένας μήνας', + 'a month', '30 days = a month' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 43 }), true), - 'ένας μήνας', + 'a month', '43 days = a month' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 46 }), true), - '2 μήνες', + '2 months', '46 days = 2 months' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 74 }), true), - '2 μήνες', + '2 months', '75 days = 2 months' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 76 }), true), - '3 μήνες', + '3 months', '76 days = 3 months' ); assert.equal( start.from(moment([2007, 1, 28]).add({ M: 1 }), true), - 'ένας μήνας', + 'a month', '1 month = a month' ); assert.equal( start.from(moment([2007, 1, 28]).add({ M: 5 }), true), - '5 μήνες', + '5 months', '5 months = 5 months' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 345 }), true), - 'ένας χρόνος', + 'a year', '345 days = a year' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 548 }), true), - '2 χρόνια', + '2 years', '548 days = 2 years' ); assert.equal( start.from(moment([2007, 1, 28]).add({ y: 1 }), true), - 'ένας χρόνος', + 'a year', '1 year = a year' ); assert.equal( start.from(moment([2007, 1, 28]).add({ y: 5 }), true), - '5 χρόνια', + '5 years', '5 years = 5 years' ); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'σε λίγα δευτερόλεπτα', 'prefix'); - assert.equal(moment(0).from(30000), 'λίγα δευτερόλεπτα πριν', 'suffix'); + assert.equal(moment(30000).from(0), 'in a few seconds', 'prefix'); + assert.equal(moment(0).from(30000), 'a few seconds ago', 'suffix'); }); test('now from now', function (assert) { assert.equal( moment().fromNow(), - 'λίγα δευτερόλεπτα πριν', + 'a few seconds ago', 'now from now should display as in the past' ); }); @@ -22735,10 +24470,10 @@ test('fromNow', function (assert) { assert.equal( moment().add({ s: 30 }).fromNow(), - 'σε λίγα δευτερόλεπτα', + 'in a few seconds', 'in a few seconds' ); - assert.equal(moment().add({ d: 5 }).fromNow(), 'σε 5 μέρες', 'in 5 days'); + assert.equal(moment().add({ d: 5 }).fromNow(), 'in 5 days', 'in 5 days'); }); test('calendar day', function (assert) { @@ -22746,32 +24481,32 @@ assert.equal( moment(a).calendar(), - 'Σήμερα στις 12:00 ΜΜ', + 'Today at 12:00 PM', 'today at the same time' ); assert.equal( moment(a).add({ m: 25 }).calendar(), - 'Σήμερα στις 12:25 ΜΜ', + 'Today at 12:25 PM', 'Now plus 25 min' ); assert.equal( moment(a).add({ h: 1 }).calendar(), - 'Σήμερα στη 1:00 ΜΜ', + 'Today at 1:00 PM', 'Now plus 1 hour' ); assert.equal( moment(a).add({ d: 1 }).calendar(), - 'Αύριο στις 12:00 ΜΜ', + 'Tomorrow at 12:00 PM', 'tomorrow at the same time' ); assert.equal( moment(a).subtract({ h: 1 }).calendar(), - 'Σήμερα στις 11:00 ΠΜ', + 'Today at 11:00 AM', 'Now minus 1 hour' ); assert.equal( moment(a).subtract({ d: 1 }).calendar(), - 'Χθες στις 12:00 ΜΜ', + 'Yesterday at 12:00 PM', 'yesterday at the same time' ); }); @@ -22782,60 +24517,44 @@ m = moment().add({ d: i }); assert.equal( m.calendar(), - m.format( - 'dddd [' + (m.hours() % 12 === 1 ? 'στη' : 'στις') + '] LT' - ), + m.format('dddd [at] LT'), 'Today + ' + i + ' days current time' ); m.hours(0).minutes(0).seconds(0).milliseconds(0); assert.equal( m.calendar(), - m.format('dddd [στις] LT'), + m.format('dddd [at] LT'), 'Today + ' + i + ' days beginning of day' ); m.hours(23).minutes(59).seconds(59).milliseconds(999); assert.equal( m.calendar(), - m.format('dddd [στις] LT'), + m.format('dddd [at] LT'), 'Today + ' + i + ' days end of day' ); } }); test('calendar last week', function (assert) { - var i, m, dayString; + var i, m; + for (i = 2; i < 7; i++) { m = moment().subtract({ d: i }); - dayString = - m.day() === 6 - ? '[το προηγούμενο Σάββατο]' - : '[την προηγούμενη] dddd'; assert.equal( m.calendar(), - m.format( - dayString + - ' [' + - (m.hours() % 12 === 1 ? 'στη' : 'στις') + - '] LT' - ), + m.format('[Last] dddd [at] LT'), 'Today - ' + i + ' days current time' ); - m.hours(1).minutes(30).seconds(0).milliseconds(0); - assert.equal( - m.calendar(), - m.format(dayString + ' [στη] LT'), - 'Today - ' + i + ' days one o clock' - ); m.hours(0).minutes(0).seconds(0).milliseconds(0); assert.equal( m.calendar(), - m.format(dayString + ' [στις] LT'), + m.format('[Last] dddd [at] LT'), 'Today - ' + i + ' days beginning of day' ); m.hours(23).minutes(59).seconds(59).milliseconds(999); assert.equal( m.calendar(), - m.format(dayString + ' [στις] LT'), + m.format('[Last] dddd [at] LT'), 'Today - ' + i + ' days end of day' ); } @@ -22863,45 +24582,65 @@ ); }); - test('weeks year starting sunday format', function (assert) { + test('weeks year starting sunday formatted', function (assert) { assert.equal( moment([2012, 0, 1]).format('w ww wo'), - '52 52 52η', - 'Jan 1 2012 should be week 52' + '1 01 1st', + 'Jan 1 2012 should be week 1' ); assert.equal( - moment([2012, 0, 7]).format('w ww wo'), - '1 01 1η', - 'Jan 7 2012 should be week 1' + moment([2012, 0, 2]).format('w ww wo'), + '1 01 1st', + 'Jan 2 2012 should be week 1' ); assert.equal( moment([2012, 0, 8]).format('w ww wo'), - '1 01 1η', - 'Jan 8 2012 should be week 1' + '2 02 2nd', + 'Jan 8 2012 should be week 2' ); assert.equal( - moment([2012, 0, 14]).format('w ww wo'), - '2 02 2η', - 'Jan 14 2012 should be week 2' + moment([2012, 0, 9]).format('w ww wo'), + '2 02 2nd', + 'Jan 9 2012 should be week 2' ); assert.equal( moment([2012, 0, 15]).format('w ww wo'), - '2 02 2η', - 'Jan 15 2012 should be week 2' + '3 03 3rd', + 'Jan 15 2012 should be week 3' ); }); - test('localeData months calls', function (assert) { - var jan = moment('2012-01-01'); - assert.equal( - moment.localeData().months(jan), - 'Ιανουάριος', - 'should return the nominative month name' + // Concrete test for Locale#weekdaysMin + test('Weekdays sort by locale', function (assert) { + assert.deepEqual( + moment().localeData('en-au').weekdays(), + 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), + 'weekdays start on Sunday' ); - assert.equal( - moment.localeData().months(jan, 'D MMMM'), - 'Ιανουαρίου', - 'should return the genitive month name' + assert.deepEqual( + moment().localeData('en-au').weekdays(true), + 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), + 'locale-sorted weekdays start on Sunday' + ); + assert.deepEqual( + moment().localeData('en-au').weekdaysShort(), + 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), + 'weekdaysShort start on Sunday' + ); + assert.deepEqual( + moment().localeData('en-au').weekdaysShort(true), + 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), + 'locale-sorted weekdaysShort start on Sunday' + ); + assert.deepEqual( + moment().localeData('en-au').weekdaysMin(), + 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), + 'weekdaysMin start on Sunday' + ); + assert.deepEqual( + moment().localeData('en-au').weekdaysMin(true), + 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), + 'locale-sorted weekdaysMin start on Sunday' ); }); @@ -23300,13 +25039,14 @@ defineCommonLocaleTests(name); } - localeModule('en-au'); + localeModule('en-ca'); test('parse', function (assert) { - var tests = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split( + var i, + tests = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split( '_' - ), - i; + ); + function equalTest(input, mmm, i) { assert.equal( moment(input, mmm).month(), @@ -23355,25 +25095,26 @@ ['D Do DD', '14 14th 14'], ['d do dddd ddd dd', '0 0th Sunday Sun Su'], ['DDD DDDo DDDD', '45 45th 045'], - ['w wo ww', '7 7th 07'], + ['w wo ww', '8 8th 08'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], ['a A', 'pm PM'], ['[the] DDDo [day of the year]', 'the 45th day of the year'], + ['L', '2010-02-14'], ['LTS', '3:25:50 PM'], - ['L', '14/02/2010'], - ['LL', '14 February 2010'], - ['LLL', '14 February 2010 3:25 PM'], - ['LLLL', 'Sunday, 14 February 2010 3:25 PM'], - ['l', '14/2/2010'], - ['ll', '14 Feb 2010'], - ['lll', '14 Feb 2010 3:25 PM'], - ['llll', 'Sun, 14 Feb 2010 3:25 PM'], + ['LL', 'February 14, 2010'], + ['LLL', 'February 14, 2010 3:25 PM'], + ['LLLL', 'Sunday, February 14, 2010 3:25 PM'], + ['l', '2010-2-14'], + ['ll', 'Feb 14, 2010'], + ['lll', 'Feb 14, 2010 3:25 PM'], + ['llll', 'Sun, Feb 14, 2010 3:25 PM'], ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; + for (i = 0; i < a.length; i++) { assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]); } @@ -23417,10 +25158,11 @@ }); test('format month', function (assert) { - var expected = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split( + var i, + expected = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split( '_' - ), - i; + ); + for (i = 0; i < expected.length; i++) { assert.equal( moment([2011, i, 1]).format('MMMM MMM'), @@ -23431,10 +25173,11 @@ }); test('format week', function (assert) { - var expected = 'Sunday Sun Su_Monday Mon Mo_Tuesday Tue Tu_Wednesday Wed We_Thursday Thu Th_Friday Fri Fr_Saturday Sat Sa'.split( + var i, + expected = 'Sunday Sun Su_Monday Mon Mo_Tuesday Tue Tu_Wednesday Wed We_Thursday Thu Th_Friday Fri Fr_Saturday Sat Sa'.split( '_' - ), - i; + ); + for (i = 0; i < expected.length; i++) { assert.equal( moment([2011, 0, 2 + i]).format('dddd ddd dd'), @@ -23647,6 +25390,7 @@ test('calendar next week', function (assert) { var i, m; + for (i = 2; i < 7; i++) { m = moment().add({ d: i }); assert.equal( @@ -23716,16 +25460,16 @@ ); }); - test('weeks year starting sunday formatted', function (assert) { + test('weeks year starting sunday format', function (assert) { assert.equal( moment([2012, 0, 1]).format('w ww wo'), '1 01 1st', 'Jan 1 2012 should be week 1' ); assert.equal( - moment([2012, 0, 2]).format('w ww wo'), + moment([2012, 0, 7]).format('w ww wo'), '1 01 1st', - 'Jan 2 2012 should be week 1' + 'Jan 7 2012 should be week 1' ); assert.equal( moment([2012, 0, 8]).format('w ww wo'), @@ -23733,9 +25477,9 @@ 'Jan 8 2012 should be week 2' ); assert.equal( - moment([2012, 0, 9]).format('w ww wo'), + moment([2012, 0, 14]).format('w ww wo'), '2 02 2nd', - 'Jan 9 2012 should be week 2' + 'Jan 14 2012 should be week 2' ); assert.equal( moment([2012, 0, 15]).format('w ww wo'), @@ -23744,40 +25488,6 @@ ); }); - // Concrete test for Locale#weekdaysMin - test('Weekdays sort by locale', function (assert) { - assert.deepEqual( - moment().localeData('en-au').weekdays(), - 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), - 'weekdays start on Sunday' - ); - assert.deepEqual( - moment().localeData('en-au').weekdays(true), - 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), - 'locale-sorted weekdays start on Sunday' - ); - assert.deepEqual( - moment().localeData('en-au').weekdaysShort(), - 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), - 'weekdaysShort start on Sunday' - ); - assert.deepEqual( - moment().localeData('en-au').weekdaysShort(true), - 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), - 'locale-sorted weekdaysShort start on Sunday' - ); - assert.deepEqual( - moment().localeData('en-au').weekdaysMin(), - 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), - 'weekdaysMin start on Sunday' - ); - assert.deepEqual( - moment().localeData('en-au').weekdaysMin(true), - 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), - 'locale-sorted weekdaysMin start on Sunday' - ); - }); - }))); @@ -24173,14 +25883,13 @@ defineCommonLocaleTests(name); } - localeModule('en-ca'); + localeModule('en-gb'); test('parse', function (assert) { - var i, - tests = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split( + var tests = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split( '_' - ); - + ), + i; function equalTest(input, mmm, i) { assert.equal( moment(input, mmm).month(), @@ -24229,26 +25938,25 @@ ['D Do DD', '14 14th 14'], ['d do dddd ddd dd', '0 0th Sunday Sun Su'], ['DDD DDDo DDDD', '45 45th 045'], - ['w wo ww', '8 8th 08'], + ['w wo ww', '6 6th 06'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], ['a A', 'pm PM'], ['[the] DDDo [day of the year]', 'the 45th day of the year'], - ['L', '2010-02-14'], - ['LTS', '3:25:50 PM'], - ['LL', 'February 14, 2010'], - ['LLL', 'February 14, 2010 3:25 PM'], - ['LLLL', 'Sunday, February 14, 2010 3:25 PM'], - ['l', '2010-2-14'], - ['ll', 'Feb 14, 2010'], - ['lll', 'Feb 14, 2010 3:25 PM'], - ['llll', 'Sun, Feb 14, 2010 3:25 PM'], + ['LTS', '15:25:50'], + ['L', '14/02/2010'], + ['LL', '14 February 2010'], + ['LLL', '14 February 2010 15:25'], + ['LLLL', 'Sunday, 14 February 2010 15:25'], + ['l', '14/2/2010'], + ['ll', '14 Feb 2010'], + ['lll', '14 Feb 2010 15:25'], + ['llll', 'Sun, 14 Feb 2010 15:25'], ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; - for (i = 0; i < a.length; i++) { assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]); } @@ -24292,11 +26000,10 @@ }); test('format month', function (assert) { - var i, - expected = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split( + var expected = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split( '_' - ); - + ), + i; for (i = 0; i < expected.length; i++) { assert.equal( moment([2011, i, 1]).format('MMMM MMM'), @@ -24307,11 +26014,10 @@ }); test('format week', function (assert) { - var i, - expected = 'Sunday Sun Su_Monday Mon Mo_Tuesday Tue Tu_Wednesday Wed We_Thursday Thu Th_Friday Fri Fr_Saturday Sat Sa'.split( + var expected = 'Sunday Sun Su_Monday Mon Mo_Tuesday Tue Tu_Wednesday Wed We_Thursday Thu Th_Friday Fri Fr_Saturday Sat Sa'.split( '_' - ); - + ), + i; for (i = 0; i < expected.length; i++) { assert.equal( moment([2011, 0, 2 + i]).format('dddd ddd dd'), @@ -24492,39 +26198,38 @@ assert.equal( moment(a).calendar(), - 'Today at 12:00 PM', + 'Today at 12:00', 'today at the same time' ); assert.equal( moment(a).add({ m: 25 }).calendar(), - 'Today at 12:25 PM', + 'Today at 12:25', 'Now plus 25 min' ); assert.equal( moment(a).add({ h: 1 }).calendar(), - 'Today at 1:00 PM', + 'Today at 13:00', 'Now plus 1 hour' ); assert.equal( moment(a).add({ d: 1 }).calendar(), - 'Tomorrow at 12:00 PM', + 'Tomorrow at 12:00', 'tomorrow at the same time' ); assert.equal( moment(a).subtract({ h: 1 }).calendar(), - 'Today at 11:00 AM', + 'Today at 11:00', 'Now minus 1 hour' ); assert.equal( moment(a).subtract({ d: 1 }).calendar(), - 'Yesterday at 12:00 PM', + 'Yesterday at 12:00', 'yesterday at the same time' ); }); test('calendar next week', function (assert) { var i, m; - for (i = 2; i < 7; i++) { m = moment().add({ d: i }); assert.equal( @@ -24594,31 +26299,31 @@ ); }); - test('weeks year starting sunday format', function (assert) { + test('weeks year starting sunday formatted', function (assert) { assert.equal( moment([2012, 0, 1]).format('w ww wo'), - '1 01 1st', - 'Jan 1 2012 should be week 1' + '52 52 52nd', + 'Jan 1 2012 should be week 52' ); assert.equal( - moment([2012, 0, 7]).format('w ww wo'), + moment([2012, 0, 2]).format('w ww wo'), '1 01 1st', - 'Jan 7 2012 should be week 1' + 'Jan 2 2012 should be week 1' ); assert.equal( moment([2012, 0, 8]).format('w ww wo'), - '2 02 2nd', - 'Jan 8 2012 should be week 2' + '1 01 1st', + 'Jan 8 2012 should be week 1' ); assert.equal( - moment([2012, 0, 14]).format('w ww wo'), + moment([2012, 0, 9]).format('w ww wo'), '2 02 2nd', - 'Jan 14 2012 should be week 2' + 'Jan 9 2012 should be week 2' ); assert.equal( moment([2012, 0, 15]).format('w ww wo'), - '3 03 3rd', - 'Jan 15 2012 should be week 3' + '2 02 2nd', + 'Jan 15 2012 should be week 2' ); }); @@ -25017,7 +26722,7 @@ defineCommonLocaleTests(name); } - localeModule('en-gb'); + localeModule('en-ie'); test('parse', function (assert) { var tests = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split( @@ -25083,11 +26788,11 @@ ['L', '14/02/2010'], ['LL', '14 February 2010'], ['LLL', '14 February 2010 15:25'], - ['LLLL', 'Sunday, 14 February 2010 15:25'], + ['LLLL', 'Sunday 14 February 2010 15:25'], ['l', '14/2/2010'], ['ll', '14 Feb 2010'], ['lll', '14 Feb 2010 15:25'], - ['llll', 'Sun, 14 Feb 2010 15:25'], + ['llll', 'Sun 14 Feb 2010 15:25'], ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -25856,7 +27561,7 @@ defineCommonLocaleTests(name); } - localeModule('en-ie'); + localeModule('en-il'); test('parse', function (assert) { var tests = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split( @@ -25911,7 +27616,7 @@ ['D Do DD', '14 14th 14'], ['d do dddd ddd dd', '0 0th Sunday Sun Su'], ['DDD DDDo DDDD', '45 45th 045'], - ['w wo ww', '6 6th 06'], + ['w wo ww', '8 8th 08'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], @@ -25922,11 +27627,11 @@ ['L', '14/02/2010'], ['LL', '14 February 2010'], ['LLL', '14 February 2010 15:25'], - ['LLLL', 'Sunday 14 February 2010 15:25'], + ['LLLL', 'Sunday, 14 February 2010 15:25'], ['l', '14/2/2010'], ['ll', '14 Feb 2010'], ['lll', '14 Feb 2010 15:25'], - ['llll', 'Sun 14 Feb 2010 15:25'], + ['llll', 'Sun, 14 Feb 2010 15:25'], ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -26275,28 +27980,36 @@ test('weeks year starting sunday formatted', function (assert) { assert.equal( moment([2012, 0, 1]).format('w ww wo'), - '52 52 52nd', - 'Jan 1 2012 should be week 52' + '1 01 1st', + 'Jan 1 2012 should be week 1' ); assert.equal( - moment([2012, 0, 2]).format('w ww wo'), + moment([2012, 0, 7]).format('w ww wo'), '1 01 1st', - 'Jan 2 2012 should be week 1' + 'Jan 7 2012 should be week 1' ); assert.equal( moment([2012, 0, 8]).format('w ww wo'), - '1 01 1st', - 'Jan 8 2012 should be week 1' + '2 02 2nd', + 'Jan 8 2012 should be week 2' ); assert.equal( - moment([2012, 0, 9]).format('w ww wo'), + moment([2012, 0, 14]).format('w ww wo'), '2 02 2nd', - 'Jan 9 2012 should be week 2' + 'Jan 14 2012 should be week 2' ); assert.equal( moment([2012, 0, 15]).format('w ww wo'), - '2 02 2nd', - 'Jan 15 2012 should be week 2' + '3 03 3rd', + 'Jan 15 2012 should be week 3' + ); + }); + + test('days start on sunday', function (assert) { + assert.equal( + moment().startOf('week').format('dddd'), + 'Sunday', + 'First day of the week should be Sunday' ); }); @@ -26695,7 +28408,7 @@ defineCommonLocaleTests(name); } - localeModule('en-il'); + localeModule('en-in'); test('parse', function (assert) { var tests = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split( @@ -26709,15 +28422,6 @@ input + ' should be month ' + (i + 1) ); } - - function equalTestStrict(input, mmm, monthIndex) { - assert.equal( - moment(input, mmm, true).month(), - monthIndex, - input + ' ' + mmm + ' should be strict month ' + (monthIndex + 1) - ); - } - for (i = 0; i < 12; i++) { tests[i] = tests[i].split(' '); equalTest(tests[i][0], 'MMM', i); @@ -26728,13 +28432,6 @@ equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i); equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i); equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i); - - equalTestStrict(tests[i][1], 'MMM', i); - equalTestStrict(tests[i][0], 'MMMM', i); - equalTestStrict(tests[i][1].toLocaleLowerCase(), 'MMM', i); - equalTestStrict(tests[i][1].toLocaleUpperCase(), 'MMM', i); - equalTestStrict(tests[i][0].toLocaleLowerCase(), 'MMMM', i); - equalTestStrict(tests[i][0].toLocaleUpperCase(), 'MMMM', i); } }); @@ -26757,15 +28454,15 @@ ['s ss', '50 50'], ['a A', 'pm PM'], ['[the] DDDo [day of the year]', 'the 45th day of the year'], - ['LTS', '15:25:50'], + ['LTS', '3:25:50 PM'], ['L', '14/02/2010'], ['LL', '14 February 2010'], - ['LLL', '14 February 2010 15:25'], - ['LLLL', 'Sunday, 14 February 2010 15:25'], + ['LLL', '14 February 2010 3:25 PM'], + ['LLLL', 'Sunday, 14 February 2010 3:25 PM'], ['l', '14/2/2010'], ['ll', '14 Feb 2010'], - ['lll', '14 Feb 2010 15:25'], - ['llll', 'Sun, 14 Feb 2010 15:25'], + ['lll', '14 Feb 2010 3:25 PM'], + ['llll', 'Sun, 14 Feb 2010 3:25 PM'], ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -27010,32 +28707,32 @@ assert.equal( moment(a).calendar(), - 'Today at 12:00', + 'Today at 12:00 PM', 'today at the same time' ); assert.equal( moment(a).add({ m: 25 }).calendar(), - 'Today at 12:25', + 'Today at 12:25 PM', 'Now plus 25 min' ); assert.equal( moment(a).add({ h: 1 }).calendar(), - 'Today at 13:00', + 'Today at 1:00 PM', 'Now plus 1 hour' ); assert.equal( moment(a).add({ d: 1 }).calendar(), - 'Tomorrow at 12:00', + 'Tomorrow at 12:00 PM', 'tomorrow at the same time' ); assert.equal( moment(a).subtract({ h: 1 }).calendar(), - 'Today at 11:00', + 'Today at 11:00 AM', 'Now minus 1 hour' ); assert.equal( moment(a).subtract({ d: 1 }).calendar(), - 'Yesterday at 12:00', + 'Yesterday at 12:00 PM', 'yesterday at the same time' ); }); @@ -27118,9 +28815,9 @@ 'Jan 1 2012 should be week 1' ); assert.equal( - moment([2012, 0, 7]).format('w ww wo'), + moment([2012, 0, 2]).format('w ww wo'), '1 01 1st', - 'Jan 7 2012 should be week 1' + 'Jan 2 2012 should be week 1' ); assert.equal( moment([2012, 0, 8]).format('w ww wo'), @@ -27128,9 +28825,9 @@ 'Jan 8 2012 should be week 2' ); assert.equal( - moment([2012, 0, 14]).format('w ww wo'), + moment([2012, 0, 9]).format('w ww wo'), '2 02 2nd', - 'Jan 14 2012 should be week 2' + 'Jan 9 2012 should be week 2' ); assert.equal( moment([2012, 0, 15]).format('w ww wo'), @@ -27139,11 +28836,37 @@ ); }); - test('days start on sunday', function (assert) { - assert.equal( - moment().startOf('week').format('dddd'), - 'Sunday', - 'First day of the week should be Sunday' + // Concrete test for Locale#weekdaysMin + test('Weekdays sort by locale', function (assert) { + assert.deepEqual( + moment().localeData('en-in').weekdays(), + 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), + 'weekdays start on Sunday' + ); + assert.deepEqual( + moment().localeData('en-in').weekdays(true), + 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), + 'locale-sorted weekdays start on Sunday' + ); + assert.deepEqual( + moment().localeData('en-in').weekdaysShort(), + 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), + 'weekdaysShort start on Sunday' + ); + assert.deepEqual( + moment().localeData('en-in').weekdaysShort(true), + 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), + 'locale-sorted weekdaysShort start on Sunday' + ); + assert.deepEqual( + moment().localeData('en-in').weekdaysMin(), + 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), + 'weekdaysMin start on Sunday' + ); + assert.deepEqual( + moment().localeData('en-in').weekdaysMin(true), + 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), + 'locale-sorted weekdaysMin start on Sunday' ); }); @@ -27542,7 +29265,7 @@ defineCommonLocaleTests(name); } - localeModule('en-in'); + localeModule('en-nz'); test('parse', function (assert) { var tests = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split( @@ -27556,6 +29279,15 @@ input + ' should be month ' + (i + 1) ); } + + function equalTestStrict(input, mmm, monthIndex) { + assert.equal( + moment(input, mmm, true).month(), + monthIndex, + input + ' ' + mmm + ' should be strict month ' + (monthIndex + 1) + ); + } + for (i = 0; i < 12; i++) { tests[i] = tests[i].split(' '); equalTest(tests[i][0], 'MMM', i); @@ -27566,6 +29298,13 @@ equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i); equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i); equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i); + + equalTestStrict(tests[i][1], 'MMM', i); + equalTestStrict(tests[i][0], 'MMMM', i); + equalTestStrict(tests[i][1].toLocaleLowerCase(), 'MMM', i); + equalTestStrict(tests[i][1].toLocaleUpperCase(), 'MMM', i); + equalTestStrict(tests[i][0].toLocaleLowerCase(), 'MMMM', i); + equalTestStrict(tests[i][0].toLocaleUpperCase(), 'MMMM', i); } }); @@ -27581,7 +29320,7 @@ ['D Do DD', '14 14th 14'], ['d do dddd ddd dd', '0 0th Sunday Sun Su'], ['DDD DDDo DDDD', '45 45th 045'], - ['w wo ww', '8 8th 08'], + ['w wo ww', '6 6th 06'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], @@ -27945,8 +29684,8 @@ test('weeks year starting sunday formatted', function (assert) { assert.equal( moment([2012, 0, 1]).format('w ww wo'), - '1 01 1st', - 'Jan 1 2012 should be week 1' + '52 52 52nd', + 'Jan 1 2012 should be week 52' ); assert.equal( moment([2012, 0, 2]).format('w ww wo'), @@ -27955,8 +29694,8 @@ ); assert.equal( moment([2012, 0, 8]).format('w ww wo'), - '2 02 2nd', - 'Jan 8 2012 should be week 2' + '1 01 1st', + 'Jan 8 2012 should be week 1' ); assert.equal( moment([2012, 0, 9]).format('w ww wo'), @@ -27965,42 +29704,8 @@ ); assert.equal( moment([2012, 0, 15]).format('w ww wo'), - '3 03 3rd', - 'Jan 15 2012 should be week 3' - ); - }); - - // Concrete test for Locale#weekdaysMin - test('Weekdays sort by locale', function (assert) { - assert.deepEqual( - moment().localeData('en-in').weekdays(), - 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), - 'weekdays start on Sunday' - ); - assert.deepEqual( - moment().localeData('en-in').weekdays(true), - 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), - 'locale-sorted weekdays start on Sunday' - ); - assert.deepEqual( - moment().localeData('en-in').weekdaysShort(), - 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), - 'weekdaysShort start on Sunday' - ); - assert.deepEqual( - moment().localeData('en-in').weekdaysShort(true), - 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), - 'locale-sorted weekdaysShort start on Sunday' - ); - assert.deepEqual( - moment().localeData('en-in').weekdaysMin(), - 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), - 'weekdaysMin start on Sunday' - ); - assert.deepEqual( - moment().localeData('en-in').weekdaysMin(true), - 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), - 'locale-sorted weekdaysMin start on Sunday' + '2 02 2nd', + 'Jan 15 2012 should be week 2' ); }); @@ -28399,7 +30104,7 @@ defineCommonLocaleTests(name); } - localeModule('en-nz'); + localeModule('en-sg'); test('parse', function (assert) { var tests = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split( @@ -28413,15 +30118,6 @@ input + ' should be month ' + (i + 1) ); } - - function equalTestStrict(input, mmm, monthIndex) { - assert.equal( - moment(input, mmm, true).month(), - monthIndex, - input + ' ' + mmm + ' should be strict month ' + (monthIndex + 1) - ); - } - for (i = 0; i < 12; i++) { tests[i] = tests[i].split(' '); equalTest(tests[i][0], 'MMM', i); @@ -28432,13 +30128,6 @@ equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i); equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i); equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i); - - equalTestStrict(tests[i][1], 'MMM', i); - equalTestStrict(tests[i][0], 'MMMM', i); - equalTestStrict(tests[i][1].toLocaleLowerCase(), 'MMM', i); - equalTestStrict(tests[i][1].toLocaleUpperCase(), 'MMM', i); - equalTestStrict(tests[i][0].toLocaleLowerCase(), 'MMMM', i); - equalTestStrict(tests[i][0].toLocaleUpperCase(), 'MMMM', i); } }); @@ -28461,15 +30150,15 @@ ['s ss', '50 50'], ['a A', 'pm PM'], ['[the] DDDo [day of the year]', 'the 45th day of the year'], - ['LTS', '3:25:50 PM'], + ['LTS', '15:25:50'], ['L', '14/02/2010'], ['LL', '14 February 2010'], - ['LLL', '14 February 2010 3:25 PM'], - ['LLLL', 'Sunday, 14 February 2010 3:25 PM'], + ['LLL', '14 February 2010 15:25'], + ['LLLL', 'Sunday, 14 February 2010 15:25'], ['l', '14/2/2010'], ['ll', '14 Feb 2010'], - ['lll', '14 Feb 2010 3:25 PM'], - ['llll', 'Sun, 14 Feb 2010 3:25 PM'], + ['lll', '14 Feb 2010 15:25'], + ['llll', 'Sun, 14 Feb 2010 15:25'], ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -28714,32 +30403,32 @@ assert.equal( moment(a).calendar(), - 'Today at 12:00 PM', + 'Today at 12:00', 'today at the same time' ); assert.equal( moment(a).add({ m: 25 }).calendar(), - 'Today at 12:25 PM', + 'Today at 12:25', 'Now plus 25 min' ); assert.equal( moment(a).add({ h: 1 }).calendar(), - 'Today at 1:00 PM', + 'Today at 13:00', 'Now plus 1 hour' ); assert.equal( moment(a).add({ d: 1 }).calendar(), - 'Tomorrow at 12:00 PM', + 'Tomorrow at 12:00', 'tomorrow at the same time' ); assert.equal( moment(a).subtract({ h: 1 }).calendar(), - 'Today at 11:00 AM', + 'Today at 11:00', 'Now minus 1 hour' ); assert.equal( moment(a).subtract({ d: 1 }).calendar(), - 'Yesterday at 12:00 PM', + 'Yesterday at 12:00', 'yesterday at the same time' ); }); @@ -29238,13 +30927,14 @@ defineCommonLocaleTests(name); } - localeModule('en-sg'); + localeModule('en'); test('parse', function (assert) { - var tests = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split( + var i, + tests = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split( '_' - ), - i; + ); + function equalTest(input, mmm, i) { assert.equal( moment(input, mmm).month(), @@ -29252,6 +30942,15 @@ input + ' should be month ' + (i + 1) ); } + + function equalTestStrict(input, mmm, monthIndex) { + assert.equal( + moment(input, mmm, true).month(), + monthIndex, + input + ' ' + mmm + ' should be strict month ' + (monthIndex + 1) + ); + } + for (i = 0; i < 12; i++) { tests[i] = tests[i].split(' '); equalTest(tests[i][0], 'MMM', i); @@ -29262,6 +30961,13 @@ equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i); equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i); equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i); + + equalTestStrict(tests[i][1], 'MMM', i); + equalTestStrict(tests[i][0], 'MMMM', i); + equalTestStrict(tests[i][1].toLocaleLowerCase(), 'MMM', i); + equalTestStrict(tests[i][1].toLocaleUpperCase(), 'MMM', i); + equalTestStrict(tests[i][0].toLocaleLowerCase(), 'MMMM', i); + equalTestStrict(tests[i][0].toLocaleUpperCase(), 'MMMM', i); } }); @@ -29277,30 +30983,105 @@ ['D Do DD', '14 14th 14'], ['d do dddd ddd dd', '0 0th Sunday Sun Su'], ['DDD DDDo DDDD', '45 45th 045'], - ['w wo ww', '6 6th 06'], + ['w wo ww', '8 8th 08'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], ['a A', 'pm PM'], ['[the] DDDo [day of the year]', 'the 45th day of the year'], - ['LTS', '15:25:50'], - ['L', '14/02/2010'], - ['LL', '14 February 2010'], - ['LLL', '14 February 2010 15:25'], - ['LLLL', 'Sunday, 14 February 2010 15:25'], - ['l', '14/2/2010'], - ['ll', '14 Feb 2010'], - ['lll', '14 Feb 2010 15:25'], - ['llll', 'Sun, 14 Feb 2010 15:25'], + ['LTS', '3:25:50 PM'], + ['L', '02/14/2010'], + ['LL', 'February 14, 2010'], + ['LLL', 'February 14, 2010 3:25 PM'], + ['LLLL', 'Sunday, February 14, 2010 3:25 PM'], + ['l', '2/14/2010'], + ['ll', 'Feb 14, 2010'], + ['lll', 'Feb 14, 2010 3:25 PM'], + ['llll', 'Sun, Feb 14, 2010 3:25 PM'], ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; + for (i = 0; i < a.length; i++) { assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]); } }); + test('parse era', function (assert) { + assert.equal(moment('2010 AD', 'y N', true).isValid(), true, '2010 AD'); + assert.equal(moment('2010 AD', 'y N', true).year(), 2010, '2010 AD'); + + assert.equal( + moment('2010 Anno Domini', 'y N', true).isValid(), + false, + '2010 Anno Domini' + ); + assert.equal( + moment('2010 Anno Domini', 'y N', false).isValid(), + true, + '2010 Anno Domini' + ); + assert.equal( + moment('2010 Anno Domini', 'y NNNN', true).isValid(), + true, + '2010 Anno Domini' + ); + assert.equal( + moment('2010 Anno Domini', 'y NNNN', true).year(), + 2010, + '2010 Anno Domini' + ); + assert.equal( + moment('2010 Anno Domini', 'y N', false).year(), + 2010, + '2010 Anno Domini' + ); + + assert.equal(moment('469 BC', 'y N', true).isValid(), true, '469 BC'); + assert.equal(moment('469 BC', 'y N', true).year(), -468, '469 BC'); + + assert.equal( + moment('469 Before Christ', 'y NNNN', true).isValid(), + true, + '469 Before Christ' + ); + assert.equal( + moment('469 Before Christ', 'y NNNN', true).year(), + -468, + '469 Before Christ' + ); + }); + + test('format era', function (assert) { + var a = [ + ['+000001-01-01', 'N, NN, NNN', 'AD, AD, AD'], + ['+000001-01-01', 'NNNN', 'Anno Domini'], + ['+000001-01-01', 'NNNNN', 'AD'], + ['+000001-01-01', 'y', '1'], + + ['+000000-12-31', 'N, NN, NNN', 'BC, BC, BC'], + ['+000000-12-31', 'NNNN', 'Before Christ'], + ['+000000-12-31', 'NNNNN', 'BC'], + ['+000000-12-31', 'y', '1'], + + ['-000001-12-31', 'N, NN, NNN', 'BC, BC, BC'], + ['-000001-12-31', 'NNNN', 'Before Christ'], + ['-000001-12-31', 'NNNNN', 'BC'], + ['-000001-12-31', 'y', '2'], + ], + i, + l; + + for (i = 0, l = a.length; i < l; ++i) { + assert.equal( + moment(a[i][0]).format(a[i][1]), + a[i][2], + a[i][0] + '; ' + a[i][1] + ' ---> ' + a[i][2] + ); + } + }); + test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1st', '1st'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2nd', '2nd'); @@ -29339,10 +31120,11 @@ }); test('format month', function (assert) { - var expected = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split( + var i, + expected = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split( '_' - ), - i; + ); + for (i = 0; i < expected.length; i++) { assert.equal( moment([2011, i, 1]).format('MMMM MMM'), @@ -29353,10 +31135,11 @@ }); test('format week', function (assert) { - var expected = 'Sunday Sun Su_Monday Mon Mo_Tuesday Tue Tu_Wednesday Wed We_Thursday Thu Th_Friday Fri Fr_Saturday Sat Sa'.split( + var i, + expected = 'Sunday Sun Su_Monday Mon Mo_Tuesday Tue Tu_Wednesday Wed We_Thursday Thu Th_Friday Fri Fr_Saturday Sat Sa'.split( '_' - ), - i; + ); + for (i = 0; i < expected.length; i++) { assert.equal( moment([2011, 0, 2 + i]).format('dddd ddd dd'), @@ -29368,6 +31151,7 @@ test('from', function (assert) { var start = moment([2007, 1, 28]); + assert.equal( start.from(moment([2007, 1, 28]).add({ s: 44 }), true), 'a few seconds', @@ -29537,38 +31321,39 @@ assert.equal( moment(a).calendar(), - 'Today at 12:00', + 'Today at 12:00 PM', 'today at the same time' ); assert.equal( moment(a).add({ m: 25 }).calendar(), - 'Today at 12:25', + 'Today at 12:25 PM', 'Now plus 25 min' ); assert.equal( moment(a).add({ h: 1 }).calendar(), - 'Today at 13:00', + 'Today at 1:00 PM', 'Now plus 1 hour' ); assert.equal( moment(a).add({ d: 1 }).calendar(), - 'Tomorrow at 12:00', + 'Tomorrow at 12:00 PM', 'tomorrow at the same time' ); assert.equal( moment(a).subtract({ h: 1 }).calendar(), - 'Today at 11:00', + 'Today at 11:00 AM', 'Now minus 1 hour' ); assert.equal( moment(a).subtract({ d: 1 }).calendar(), - 'Yesterday at 12:00', + 'Yesterday at 12:00 PM', 'yesterday at the same time' ); }); test('calendar next week', function (assert) { var i, m; + for (i = 2; i < 7; i++) { m = moment().add({ d: i }); assert.equal( @@ -29638,34 +31423,70 @@ ); }); - test('weeks year starting sunday formatted', function (assert) { + test('weeks year starting sunday format', function (assert) { assert.equal( moment([2012, 0, 1]).format('w ww wo'), - '52 52 52nd', - 'Jan 1 2012 should be week 52' + '1 01 1st', + 'Jan 1 2012 should be week 1' ); assert.equal( - moment([2012, 0, 2]).format('w ww wo'), + moment([2012, 0, 7]).format('w ww wo'), '1 01 1st', - 'Jan 2 2012 should be week 1' + 'Jan 7 2012 should be week 1' ); assert.equal( moment([2012, 0, 8]).format('w ww wo'), - '1 01 1st', - 'Jan 8 2012 should be week 1' + '2 02 2nd', + 'Jan 8 2012 should be week 2' ); assert.equal( - moment([2012, 0, 9]).format('w ww wo'), + moment([2012, 0, 14]).format('w ww wo'), '2 02 2nd', - 'Jan 9 2012 should be week 2' + 'Jan 14 2012 should be week 2' ); assert.equal( moment([2012, 0, 15]).format('w ww wo'), - '2 02 2nd', - 'Jan 15 2012 should be week 2' + '3 03 3rd', + 'Jan 15 2012 should be week 3' ); }); + test('weekdays strict parsing', function (assert) { + var m = moment('2015-01-01T12', moment.ISO_8601, true), + enLocale = moment.localeData('en'), + i; + + for (i = 0; i < 7; ++i) { + assert.equal( + moment(enLocale.weekdays(m.day(i), ''), 'dddd', true).isValid(), + true, + 'parse weekday ' + i + ); + assert.equal( + moment(enLocale.weekdaysShort(m.day(i), ''), 'ddd', true).isValid(), + true, + 'parse short weekday ' + i + ); + assert.equal( + moment(enLocale.weekdaysMin(m.day(i), ''), 'dd', true).isValid(), + true, + 'parse min weekday ' + i + ); + + // negative tests + assert.equal( + moment(enLocale.weekdaysMin(m.day(i), ''), 'ddd', true).isValid(), + false, + 'parse short weekday ' + i + ); + assert.equal( + moment(enLocale.weekdaysShort(m.day(i), ''), 'dd', true).isValid(), + false, + 'parse min weekday ' + i + ); + } + }); + }))); @@ -30061,14 +31882,13 @@ defineCommonLocaleTests(name); } - localeModule('en'); + localeModule('eo'); test('parse', function (assert) { - var i, - tests = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split( + var tests = 'januaro jan_februaro feb_marto mart_aprilo apr_majo maj_junio jun_julio jul_aŭgusto aŭg_septembro sept_oktobro okt_novembro nov_decembro dec'.split( '_' - ); - + ), + i; function equalTest(input, mmm, i) { assert.equal( moment(input, mmm).month(), @@ -30109,156 +31929,80 @@ var a = [ [ 'dddd, MMMM Do YYYY, h:mm:ss a', - 'Sunday, February 14th 2010, 3:25:50 pm', + 'dimanĉo, februaro 14a 2010, 3:25:50 p.t.m.', ], - ['ddd, hA', 'Sun, 3PM'], - ['M Mo MM MMMM MMM', '2 2nd 02 February Feb'], + ['ddd, hA', 'dim, 3P.T.M.'], + ['M Mo MM MMMM MMM', '2 2a 02 februaro feb'], ['YYYY YY', '2010 10'], - ['D Do DD', '14 14th 14'], - ['d do dddd ddd dd', '0 0th Sunday Sun Su'], - ['DDD DDDo DDDD', '45 45th 045'], - ['w wo ww', '8 8th 08'], + ['D Do DD', '14 14a 14'], + ['d do dddd ddd dd', '0 0a dimanĉo dim di'], + ['DDD DDDo DDDD', '45 45a 045'], + ['w wo ww', '7 7a 07'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], - ['a A', 'pm PM'], - ['[the] DDDo [day of the year]', 'the 45th day of the year'], - ['LTS', '3:25:50 PM'], - ['L', '02/14/2010'], - ['LL', 'February 14, 2010'], - ['LLL', 'February 14, 2010 3:25 PM'], - ['LLLL', 'Sunday, February 14, 2010 3:25 PM'], - ['l', '2/14/2010'], - ['ll', 'Feb 14, 2010'], - ['lll', 'Feb 14, 2010 3:25 PM'], - ['llll', 'Sun, Feb 14, 2010 3:25 PM'], + ['a A', 'p.t.m. P.T.M.'], + ['[la] DDDo [tago] [de] [la] [jaro]', 'la 45a tago de la jaro'], + ['LTS', '15:25:50'], + ['L', '2010-02-14'], + ['LL', 'la 14-an de februaro, 2010'], + ['LLL', 'la 14-an de februaro, 2010 15:25'], + ['LLLL', 'dimanĉon, la 14-an de februaro, 2010 15:25'], + ['l', '2010-2-14'], + ['ll', 'la 14-an de feb, 2010'], + ['lll', 'la 14-an de feb, 2010 15:25'], + ['llll', 'dim, la 14-an de feb, 2010 15:25'], ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; - for (i = 0; i < a.length; i++) { assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]); } }); - test('parse era', function (assert) { - assert.equal(moment('2010 AD', 'y N', true).isValid(), true, '2010 AD'); - assert.equal(moment('2010 AD', 'y N', true).year(), 2010, '2010 AD'); - - assert.equal( - moment('2010 Anno Domini', 'y N', true).isValid(), - false, - '2010 Anno Domini' - ); - assert.equal( - moment('2010 Anno Domini', 'y N', false).isValid(), - true, - '2010 Anno Domini' - ); - assert.equal( - moment('2010 Anno Domini', 'y NNNN', true).isValid(), - true, - '2010 Anno Domini' - ); - assert.equal( - moment('2010 Anno Domini', 'y NNNN', true).year(), - 2010, - '2010 Anno Domini' - ); - assert.equal( - moment('2010 Anno Domini', 'y N', false).year(), - 2010, - '2010 Anno Domini' - ); - - assert.equal(moment('469 BC', 'y N', true).isValid(), true, '469 BC'); - assert.equal(moment('469 BC', 'y N', true).year(), -468, '469 BC'); - - assert.equal( - moment('469 Before Christ', 'y NNNN', true).isValid(), - true, - '469 Before Christ' - ); - assert.equal( - moment('469 Before Christ', 'y NNNN', true).year(), - -468, - '469 Before Christ' - ); - }); - - test('format era', function (assert) { - var a = [ - ['+000001-01-01', 'N, NN, NNN', 'AD, AD, AD'], - ['+000001-01-01', 'NNNN', 'Anno Domini'], - ['+000001-01-01', 'NNNNN', 'AD'], - ['+000001-01-01', 'y', '1'], - - ['+000000-12-31', 'N, NN, NNN', 'BC, BC, BC'], - ['+000000-12-31', 'NNNN', 'Before Christ'], - ['+000000-12-31', 'NNNNN', 'BC'], - ['+000000-12-31', 'y', '1'], - - ['-000001-12-31', 'N, NN, NNN', 'BC, BC, BC'], - ['-000001-12-31', 'NNNN', 'Before Christ'], - ['-000001-12-31', 'NNNNN', 'BC'], - ['-000001-12-31', 'y', '2'], - ], - i, - l; - - for (i = 0, l = a.length; i < l; ++i) { - assert.equal( - moment(a[i][0]).format(a[i][1]), - a[i][2], - a[i][0] + '; ' + a[i][1] + ' ---> ' + a[i][2] - ); - } - }); - test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1st', '1st'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '2nd', '2nd'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '3rd', '3rd'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '4th', '4th'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '5th', '5th'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '6th', '6th'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '7th', '7th'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '8th', '8th'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '9th', '9th'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '10th', '10th'); + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1a', '1a'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2a', '2a'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3a', '3a'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4a', '4a'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5a', '5a'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6a', '6a'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7a', '7a'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8a', '8a'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9a', '9a'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10a', '10a'); - assert.equal(moment([2011, 0, 11]).format('DDDo'), '11th', '11th'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '12th', '12th'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '13th', '13th'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '14th', '14th'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '15th', '15th'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '16th', '16th'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '17th', '17th'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '18th', '18th'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '19th', '19th'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '20th', '20th'); + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11a', '11a'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12a', '12a'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13a', '13a'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14a', '14a'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15a', '15a'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16a', '16a'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17a', '17a'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18a', '18a'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19a', '19a'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20a', '20a'); - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21st', '21st'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22nd', '22nd'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23rd', '23rd'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24th', '24th'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25th', '25th'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26th', '26th'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27th', '27th'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28th', '28th'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29th', '29th'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30th', '30th'); + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21a', '21a'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22a', '22a'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23a', '23a'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24a', '24a'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25a', '25a'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26a', '26a'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27a', '27a'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28a', '28a'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29a', '29a'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30a', '30a'); - assert.equal(moment([2011, 0, 31]).format('DDDo'), '31st', '31st'); + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31a', '31a'); }); test('format month', function (assert) { - var i, - expected = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split( + var expected = 'januaro jan_februaro feb_marto mart_aprilo apr_majo maj_junio jun_julio jul_aŭgusto aŭg_septembro sept_oktobro okt_novembro nov_decembro dec'.split( '_' - ); - + ), + i; for (i = 0; i < expected.length; i++) { assert.equal( moment([2011, i, 1]).format('MMMM MMM'), @@ -30269,11 +32013,10 @@ }); test('format week', function (assert) { - var i, - expected = 'Sunday Sun Su_Monday Mon Mo_Tuesday Tue Tu_Wednesday Wed We_Thursday Thu Th_Friday Fri Fr_Saturday Sat Sa'.split( + var expected = 'dimanĉo dim di_lundo lun lu_mardo mard ma_merkredo merk me_ĵaŭdo ĵaŭ ĵa_vendredo ven ve_sabato sab sa'.split( '_' - ); - + ), + i; for (i = 0; i < expected.length; i++) { assert.equal( moment([2011, 0, 2 + i]).format('dddd ddd dd'), @@ -30285,158 +32028,161 @@ test('from', function (assert) { var start = moment([2007, 1, 28]); - assert.equal( start.from(moment([2007, 1, 28]).add({ s: 44 }), true), - 'a few seconds', + 'kelkaj sekundoj', '44 seconds = a few seconds' ); assert.equal( start.from(moment([2007, 1, 28]).add({ s: 45 }), true), - 'a minute', + 'unu minuto', '45 seconds = a minute' ); assert.equal( start.from(moment([2007, 1, 28]).add({ s: 89 }), true), - 'a minute', + 'unu minuto', '89 seconds = a minute' ); assert.equal( start.from(moment([2007, 1, 28]).add({ s: 90 }), true), - '2 minutes', + '2 minutoj', '90 seconds = 2 minutes' ); assert.equal( start.from(moment([2007, 1, 28]).add({ m: 44 }), true), - '44 minutes', + '44 minutoj', '44 minutes = 44 minutes' ); assert.equal( start.from(moment([2007, 1, 28]).add({ m: 45 }), true), - 'an hour', + 'unu horo', '45 minutes = an hour' ); assert.equal( start.from(moment([2007, 1, 28]).add({ m: 89 }), true), - 'an hour', + 'unu horo', '89 minutes = an hour' ); assert.equal( start.from(moment([2007, 1, 28]).add({ m: 90 }), true), - '2 hours', + '2 horoj', '90 minutes = 2 hours' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 5 }), true), - '5 hours', + '5 horoj', '5 hours = 5 hours' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 21 }), true), - '21 hours', + '21 horoj', '21 hours = 21 hours' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 22 }), true), - 'a day', + 'unu tago', '22 hours = a day' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 35 }), true), - 'a day', + 'unu tago', '35 hours = a day' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 36 }), true), - '2 days', + '2 tagoj', '36 hours = 2 days' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 1 }), true), - 'a day', + 'unu tago', '1 day = a day' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 5 }), true), - '5 days', + '5 tagoj', '5 days = 5 days' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 25 }), true), - '25 days', + '25 tagoj', '25 days = 25 days' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 26 }), true), - 'a month', + 'unu monato', '26 days = a month' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 30 }), true), - 'a month', + 'unu monato', '30 days = a month' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 43 }), true), - 'a month', + 'unu monato', '43 days = a month' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 46 }), true), - '2 months', + '2 monatoj', '46 days = 2 months' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 74 }), true), - '2 months', + '2 monatoj', '75 days = 2 months' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 76 }), true), - '3 months', + '3 monatoj', '76 days = 3 months' ); assert.equal( start.from(moment([2007, 1, 28]).add({ M: 1 }), true), - 'a month', + 'unu monato', '1 month = a month' ); assert.equal( start.from(moment([2007, 1, 28]).add({ M: 5 }), true), - '5 months', + '5 monatoj', '5 months = 5 months' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 345 }), true), - 'a year', + 'unu jaro', '345 days = a year' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 548 }), true), - '2 years', + '2 jaroj', '548 days = 2 years' ); assert.equal( start.from(moment([2007, 1, 28]).add({ y: 1 }), true), - 'a year', + 'unu jaro', '1 year = a year' ); assert.equal( start.from(moment([2007, 1, 28]).add({ y: 5 }), true), - '5 years', + '5 jaroj', '5 years = 5 years' ); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'in a few seconds', 'prefix'); - assert.equal(moment(0).from(30000), 'a few seconds ago', 'suffix'); + assert.equal(moment(30000).from(0), 'post kelkaj sekundoj', 'post prefix'); + assert.equal( + moment(0).from(30000), + 'antaŭ kelkaj sekundoj', + 'antaŭ prefix' + ); }); test('now from now', function (assert) { assert.equal( moment().fromNow(), - 'a few seconds ago', + 'antaŭ kelkaj sekundoj', 'now from now should display as in the past' ); }); @@ -30444,10 +32190,14 @@ test('fromNow', function (assert) { assert.equal( moment().add({ s: 30 }).fromNow(), - 'in a few seconds', - 'in a few seconds' + 'post kelkaj sekundoj', + 'post kelkaj sekundoj' + ); + assert.equal( + moment().add({ d: 5 }).fromNow(), + 'post 5 tagoj', + 'post 5 tagoj' ); - assert.equal(moment().add({ d: 5 }).fromNow(), 'in 5 days', 'in 5 days'); }); test('calendar day', function (assert) { @@ -30455,32 +32205,32 @@ assert.equal( moment(a).calendar(), - 'Today at 12:00 PM', + 'Hodiaŭ je 12:00', 'today at the same time' ); assert.equal( moment(a).add({ m: 25 }).calendar(), - 'Today at 12:25 PM', + 'Hodiaŭ je 12:25', 'Now plus 25 min' ); assert.equal( moment(a).add({ h: 1 }).calendar(), - 'Today at 1:00 PM', + 'Hodiaŭ je 13:00', 'Now plus 1 hour' ); assert.equal( moment(a).add({ d: 1 }).calendar(), - 'Tomorrow at 12:00 PM', + 'Morgaŭ je 12:00', 'tomorrow at the same time' ); assert.equal( moment(a).subtract({ h: 1 }).calendar(), - 'Today at 11:00 AM', + 'Hodiaŭ je 11:00', 'Now minus 1 hour' ); assert.equal( moment(a).subtract({ d: 1 }).calendar(), - 'Yesterday at 12:00 PM', + 'Hieraŭ je 12:00', 'yesterday at the same time' ); }); @@ -30492,19 +32242,19 @@ m = moment().add({ d: i }); assert.equal( m.calendar(), - m.format('dddd [at] LT'), + m.format('dddd[n] [je] LT'), 'Today + ' + i + ' days current time' ); m.hours(0).minutes(0).seconds(0).milliseconds(0); assert.equal( m.calendar(), - m.format('dddd [at] LT'), + m.format('dddd[n] [je] LT'), 'Today + ' + i + ' days beginning of day' ); m.hours(23).minutes(59).seconds(59).milliseconds(999); assert.equal( m.calendar(), - m.format('dddd [at] LT'), + m.format('dddd[n] [je] LT'), 'Today + ' + i + ' days end of day' ); } @@ -30517,19 +32267,19 @@ m = moment().subtract({ d: i }); assert.equal( m.calendar(), - m.format('[Last] dddd [at] LT'), + m.format('[pasintan] dddd[n je] LT'), 'Today - ' + i + ' days current time' ); m.hours(0).minutes(0).seconds(0).milliseconds(0); assert.equal( m.calendar(), - m.format('[Last] dddd [at] LT'), + m.format('[pasintan] dddd[n je] LT'), 'Today - ' + i + ' days beginning of day' ); m.hours(23).minutes(59).seconds(59).milliseconds(999); assert.equal( m.calendar(), - m.format('[Last] dddd [at] LT'), + m.format('[pasintan] dddd[n je] LT'), 'Today - ' + i + ' days end of day' ); } @@ -30557,70 +32307,34 @@ ); }); - test('weeks year starting sunday format', function (assert) { + test('weeks year starting sunday formatted', function (assert) { + assert.equal( + moment([2011, 11, 26]).format('w ww wo'), + '1 01 1a', + 'Dec 26 2011 should be week 1' + ); assert.equal( moment([2012, 0, 1]).format('w ww wo'), - '1 01 1st', + '1 01 1a', 'Jan 1 2012 should be week 1' ); assert.equal( - moment([2012, 0, 7]).format('w ww wo'), - '1 01 1st', - 'Jan 7 2012 should be week 1' + moment([2012, 0, 2]).format('w ww wo'), + '2 02 2a', + 'Jan 2 2012 should be week 2' ); assert.equal( moment([2012, 0, 8]).format('w ww wo'), - '2 02 2nd', + '2 02 2a', 'Jan 8 2012 should be week 2' ); assert.equal( - moment([2012, 0, 14]).format('w ww wo'), - '2 02 2nd', - 'Jan 14 2012 should be week 2' - ); - assert.equal( - moment([2012, 0, 15]).format('w ww wo'), - '3 03 3rd', - 'Jan 15 2012 should be week 3' + moment([2012, 0, 9]).format('w ww wo'), + '3 03 3a', + 'Jan 9 2012 should be week 3' ); }); - test('weekdays strict parsing', function (assert) { - var m = moment('2015-01-01T12', moment.ISO_8601, true), - enLocale = moment.localeData('en'), - i; - - for (i = 0; i < 7; ++i) { - assert.equal( - moment(enLocale.weekdays(m.day(i), ''), 'dddd', true).isValid(), - true, - 'parse weekday ' + i - ); - assert.equal( - moment(enLocale.weekdaysShort(m.day(i), ''), 'ddd', true).isValid(), - true, - 'parse short weekday ' + i - ); - assert.equal( - moment(enLocale.weekdaysMin(m.day(i), ''), 'dd', true).isValid(), - true, - 'parse min weekday ' + i - ); - - // negative tests - assert.equal( - moment(enLocale.weekdaysMin(m.day(i), ''), 'ddd', true).isValid(), - false, - 'parse short weekday ' + i - ); - assert.equal( - moment(enLocale.weekdaysShort(m.day(i), ''), 'dd', true).isValid(), - false, - 'parse min weekday ' + i - ); - } - }); - }))); @@ -31016,10 +32730,10 @@ defineCommonLocaleTests(name); } - localeModule('eo'); + localeModule('es-do'); test('parse', function (assert) { - var tests = 'januaro jan_februaro feb_marto mart_aprilo apr_majo maj_junio jun_julio jul_aŭgusto aŭg_septembro sept_oktobro okt_novembro nov_decembro dec'.split( + var tests = 'enero ene._febrero feb._marzo mar._abril abr._mayo may._junio jun._julio jul._agosto ago._septiembre sep._octubre oct._noviembre nov._diciembre dic.'.split( '_' ), i; @@ -31063,30 +32777,31 @@ var a = [ [ 'dddd, MMMM Do YYYY, h:mm:ss a', - 'dimanĉo, februaro 14a 2010, 3:25:50 p.t.m.', + 'domingo, febrero 14º 2010, 3:25:50 pm', ], - ['ddd, hA', 'dim, 3P.T.M.'], - ['M Mo MM MMMM MMM', '2 2a 02 februaro feb'], + ['ddd, hA', 'dom., 3PM'], + ['M Mo MM MMMM MMM', '2 2º 02 febrero feb.'], ['YYYY YY', '2010 10'], - ['D Do DD', '14 14a 14'], - ['d do dddd ddd dd', '0 0a dimanĉo dim di'], - ['DDD DDDo DDDD', '45 45a 045'], - ['w wo ww', '7 7a 07'], + ['D Do DD', '14 14º 14'], + ['d do dddd ddd dd', '0 0º domingo dom. do'], + ['DDD DDDo DDDD', '45 45º 045'], + ['w wo ww', '6 6º 06'], + ['YYYY-MMM-DD', '2010-feb-14'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], - ['a A', 'p.t.m. P.T.M.'], - ['[la] DDDo [tago] [de] [la] [jaro]', 'la 45a tago de la jaro'], - ['LTS', '15:25:50'], - ['L', '2010-02-14'], - ['LL', 'la 14-an de februaro, 2010'], - ['LLL', 'la 14-an de februaro, 2010 15:25'], - ['LLLL', 'dimanĉon, la 14-an de februaro, 2010 15:25'], - ['l', '2010-2-14'], - ['ll', 'la 14-an de feb, 2010'], - ['lll', 'la 14-an de feb, 2010 15:25'], - ['llll', 'dim, la 14-an de feb, 2010 15:25'], + ['a A', 'pm PM'], + ['[the] DDDo [day of the year]', 'the 45º day of the year'], + ['LTS', '3:25:50 PM'], + ['L', '14/02/2010'], + ['LL', '14 de febrero de 2010'], + ['LLL', '14 de febrero de 2010 3:25 PM'], + ['LLLL', 'domingo, 14 de febrero de 2010 3:25 PM'], + ['l', '14/2/2010'], + ['ll', '14 de feb. de 2010'], + ['lll', '14 de feb. de 2010 3:25 PM'], + ['llll', 'dom., 14 de feb. de 2010 3:25 PM'], ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -31096,44 +32811,44 @@ }); test('format ordinal', function (assert) { - assert.equal(moment([2011, 0, 1]).format('DDDo'), '1a', '1a'); - assert.equal(moment([2011, 0, 2]).format('DDDo'), '2a', '2a'); - assert.equal(moment([2011, 0, 3]).format('DDDo'), '3a', '3a'); - assert.equal(moment([2011, 0, 4]).format('DDDo'), '4a', '4a'); - assert.equal(moment([2011, 0, 5]).format('DDDo'), '5a', '5a'); - assert.equal(moment([2011, 0, 6]).format('DDDo'), '6a', '6a'); - assert.equal(moment([2011, 0, 7]).format('DDDo'), '7a', '7a'); - assert.equal(moment([2011, 0, 8]).format('DDDo'), '8a', '8a'); - assert.equal(moment([2011, 0, 9]).format('DDDo'), '9a', '9a'); - assert.equal(moment([2011, 0, 10]).format('DDDo'), '10a', '10a'); + assert.equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º'); - assert.equal(moment([2011, 0, 11]).format('DDDo'), '11a', '11a'); - assert.equal(moment([2011, 0, 12]).format('DDDo'), '12a', '12a'); - assert.equal(moment([2011, 0, 13]).format('DDDo'), '13a', '13a'); - assert.equal(moment([2011, 0, 14]).format('DDDo'), '14a', '14a'); - assert.equal(moment([2011, 0, 15]).format('DDDo'), '15a', '15a'); - assert.equal(moment([2011, 0, 16]).format('DDDo'), '16a', '16a'); - assert.equal(moment([2011, 0, 17]).format('DDDo'), '17a', '17a'); - assert.equal(moment([2011, 0, 18]).format('DDDo'), '18a', '18a'); - assert.equal(moment([2011, 0, 19]).format('DDDo'), '19a', '19a'); - assert.equal(moment([2011, 0, 20]).format('DDDo'), '20a', '20a'); + assert.equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º'); - assert.equal(moment([2011, 0, 21]).format('DDDo'), '21a', '21a'); - assert.equal(moment([2011, 0, 22]).format('DDDo'), '22a', '22a'); - assert.equal(moment([2011, 0, 23]).format('DDDo'), '23a', '23a'); - assert.equal(moment([2011, 0, 24]).format('DDDo'), '24a', '24a'); - assert.equal(moment([2011, 0, 25]).format('DDDo'), '25a', '25a'); - assert.equal(moment([2011, 0, 26]).format('DDDo'), '26a', '26a'); - assert.equal(moment([2011, 0, 27]).format('DDDo'), '27a', '27a'); - assert.equal(moment([2011, 0, 28]).format('DDDo'), '28a', '28a'); - assert.equal(moment([2011, 0, 29]).format('DDDo'), '29a', '29a'); - assert.equal(moment([2011, 0, 30]).format('DDDo'), '30a', '30a'); + assert.equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º'); - assert.equal(moment([2011, 0, 31]).format('DDDo'), '31a', '31a'); + assert.equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º'); }); test('format month', function (assert) { - var expected = 'januaro jan_februaro feb_marto mart_aprilo apr_majo maj_junio jun_julio jul_aŭgusto aŭg_septembro sept_oktobro okt_novembro nov_decembro dec'.split( + 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( '_' ), i; @@ -31147,7 +32862,7 @@ }); test('format week', function (assert) { - var expected = 'dimanĉo dim di_lundo lun lu_mardo mard ma_merkredo merk me_ĵaŭdo ĵaŭ ĵa_vendredo ven ve_sabato sab sa'.split( + var expected = 'domingo dom. do_lunes lun. lu_martes mar. ma_miércoles mié. mi_jueves jue. ju_viernes vie. vi_sábado sáb. sá'.split( '_' ), i; @@ -31164,159 +32879,155 @@ var start = moment([2007, 1, 28]); assert.equal( start.from(moment([2007, 1, 28]).add({ s: 44 }), true), - 'kelkaj sekundoj', + 'unos segundos', '44 seconds = a few seconds' ); assert.equal( start.from(moment([2007, 1, 28]).add({ s: 45 }), true), - 'unu minuto', + 'un minuto', '45 seconds = a minute' ); assert.equal( start.from(moment([2007, 1, 28]).add({ s: 89 }), true), - 'unu minuto', + 'un minuto', '89 seconds = a minute' ); assert.equal( start.from(moment([2007, 1, 28]).add({ s: 90 }), true), - '2 minutoj', + '2 minutos', '90 seconds = 2 minutes' ); assert.equal( start.from(moment([2007, 1, 28]).add({ m: 44 }), true), - '44 minutoj', + '44 minutos', '44 minutes = 44 minutes' ); assert.equal( start.from(moment([2007, 1, 28]).add({ m: 45 }), true), - 'unu horo', + 'una hora', '45 minutes = an hour' ); assert.equal( start.from(moment([2007, 1, 28]).add({ m: 89 }), true), - 'unu horo', + 'una hora', '89 minutes = an hour' ); assert.equal( start.from(moment([2007, 1, 28]).add({ m: 90 }), true), - '2 horoj', + '2 horas', '90 minutes = 2 hours' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 5 }), true), - '5 horoj', + '5 horas', '5 hours = 5 hours' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 21 }), true), - '21 horoj', + '21 horas', '21 hours = 21 hours' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 22 }), true), - 'unu tago', + 'un día', '22 hours = a day' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 35 }), true), - 'unu tago', + 'un día', '35 hours = a day' ); assert.equal( start.from(moment([2007, 1, 28]).add({ h: 36 }), true), - '2 tagoj', + '2 días', '36 hours = 2 days' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 1 }), true), - 'unu tago', + 'un día', '1 day = a day' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 5 }), true), - '5 tagoj', + '5 días', '5 days = 5 days' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 25 }), true), - '25 tagoj', + '25 días', '25 days = 25 days' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 26 }), true), - 'unu monato', + 'un mes', '26 days = a month' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 30 }), true), - 'unu monato', + 'un mes', '30 days = a month' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 43 }), true), - 'unu monato', + 'un mes', '43 days = a month' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 46 }), true), - '2 monatoj', + '2 meses', '46 days = 2 months' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 74 }), true), - '2 monatoj', + '2 meses', '75 days = 2 months' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 76 }), true), - '3 monatoj', + '3 meses', '76 days = 3 months' ); assert.equal( start.from(moment([2007, 1, 28]).add({ M: 1 }), true), - 'unu monato', + 'un mes', '1 month = a month' ); assert.equal( start.from(moment([2007, 1, 28]).add({ M: 5 }), true), - '5 monatoj', + '5 meses', '5 months = 5 months' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 345 }), true), - 'unu jaro', + 'un año', '345 days = a year' ); assert.equal( start.from(moment([2007, 1, 28]).add({ d: 548 }), true), - '2 jaroj', + '2 años', '548 days = 2 years' ); assert.equal( start.from(moment([2007, 1, 28]).add({ y: 1 }), true), - 'unu jaro', + 'un año', '1 year = a year' ); assert.equal( start.from(moment([2007, 1, 28]).add({ y: 5 }), true), - '5 jaroj', + '5 años', '5 years = 5 years' ); }); test('suffix', function (assert) { - assert.equal(moment(30000).from(0), 'post kelkaj sekundoj', 'post prefix'); - assert.equal( - moment(0).from(30000), - 'antaŭ kelkaj sekundoj', - 'antaŭ prefix' - ); + assert.equal(moment(30000).from(0), 'en unos segundos', 'prefix'); + assert.equal(moment(0).from(30000), 'hace unos segundos', 'suffix'); }); test('now from now', function (assert) { assert.equal( moment().fromNow(), - 'antaŭ kelkaj sekundoj', + 'hace unos segundos', 'now from now should display as in the past' ); }); @@ -31324,14 +33035,10 @@ test('fromNow', function (assert) { assert.equal( moment().add({ s: 30 }).fromNow(), - 'post kelkaj sekundoj', - 'post kelkaj sekundoj' - ); - assert.equal( - moment().add({ d: 5 }).fromNow(), - 'post 5 tagoj', - 'post 5 tagoj' + 'en unos segundos', + 'en unos segundos' ); + assert.equal(moment().add({ d: 5 }).fromNow(), 'en 5 días', 'en 5 días'); }); test('calendar day', function (assert) { @@ -31339,32 +33046,37 @@ assert.equal( moment(a).calendar(), - 'Hodiaŭ je 12:00', + 'hoy a las 12:00 PM', 'today at the same time' ); assert.equal( moment(a).add({ m: 25 }).calendar(), - 'Hodiaŭ je 12:25', + 'hoy a las 12:25 PM', 'Now plus 25 min' ); assert.equal( moment(a).add({ h: 1 }).calendar(), - 'Hodiaŭ je 13:00', + 'hoy a las 1:00 PM', 'Now plus 1 hour' ); assert.equal( moment(a).add({ d: 1 }).calendar(), - 'Morgaŭ je 12:00', + 'mañana a las 12:00 PM', 'tomorrow at the same time' ); + assert.equal( + moment(a).add({ d: 1, h: -1 }).calendar(), + 'mañana a las 11:00 AM', + 'tomorrow minus 1 hour' + ); assert.equal( moment(a).subtract({ h: 1 }).calendar(), - 'Hodiaŭ je 11:00', + 'hoy a las 11:00 AM', 'Now minus 1 hour' ); assert.equal( moment(a).subtract({ d: 1 }).calendar(), - 'Hieraŭ je 12:00', + 'ayer a las 12:00 PM', 'yesterday at the same time' ); }); @@ -31376,19 +33088,19 @@ m = moment().add({ d: i }); assert.equal( m.calendar(), - m.format('dddd[n] [je] LT'), + m.format('dddd [a la' + (m.hours() !== 1 ? 's' : '') + '] LT'), 'Today + ' + i + ' days current time' ); m.hours(0).minutes(0).seconds(0).milliseconds(0); assert.equal( m.calendar(), - m.format('dddd[n] [je] LT'), + m.format('dddd [a la' + (m.hours() !== 1 ? 's' : '') + '] LT'), 'Today + ' + i + ' days beginning of day' ); m.hours(23).minutes(59).seconds(59).milliseconds(999); assert.equal( m.calendar(), - m.format('dddd[n] [je] LT'), + m.format('dddd [a la' + (m.hours() !== 1 ? 's' : '') + '] LT'), 'Today + ' + i + ' days end of day' ); } @@ -31401,19 +33113,25 @@ m = moment().subtract({ d: i }); assert.equal( m.calendar(), - m.format('[pasintan] dddd[n je] LT'), + m.format( + '[el] dddd [pasado a la' + (m.hours() !== 1 ? 's' : '') + '] LT' + ), 'Today - ' + i + ' days current time' ); m.hours(0).minutes(0).seconds(0).milliseconds(0); assert.equal( m.calendar(), - m.format('[pasintan] dddd[n je] LT'), + m.format( + '[el] dddd [pasado a la' + (m.hours() !== 1 ? 's' : '') + '] LT' + ), 'Today - ' + i + ' days beginning of day' ); m.hours(23).minutes(59).seconds(59).milliseconds(999); assert.equal( m.calendar(), - m.format('[pasintan] dddd[n je] LT'), + m.format( + '[el] dddd [pasado a la' + (m.hours() !== 1 ? 's' : '') + '] LT' + ), 'Today - ' + i + ' days end of day' ); } @@ -31442,30 +33160,44 @@ }); test('weeks year starting sunday formatted', function (assert) { - assert.equal( - moment([2011, 11, 26]).format('w ww wo'), - '1 01 1a', - 'Dec 26 2011 should be week 1' - ); assert.equal( moment([2012, 0, 1]).format('w ww wo'), - '1 01 1a', - 'Jan 1 2012 should be week 1' + '52 52 52º', + 'Jan 1 2012 should be week 52' ); assert.equal( moment([2012, 0, 2]).format('w ww wo'), - '2 02 2a', - 'Jan 2 2012 should be week 2' + '1 01 1º', + 'Jan 2 2012 should be week 1' ); assert.equal( moment([2012, 0, 8]).format('w ww wo'), - '2 02 2a', - 'Jan 8 2012 should be week 2' + '1 01 1º', + 'Jan 8 2012 should be week 1' ); assert.equal( moment([2012, 0, 9]).format('w ww wo'), - '3 03 3a', - 'Jan 9 2012 should be week 3' + '2 02 2º', + 'Jan 9 2012 should be week 2' + ); + assert.equal( + moment([2012, 0, 15]).format('w ww wo'), + '2 02 2º', + 'Jan 15 2012 should be week 2' + ); + }); + + test('test short months proper', function (assert) { + var str = '02-ago-2016'; // "02-ago-2016" + assert.equal( + moment(str, 'DD-MMM-YYYY').month(), + 7, + '02-ago-2016 month should be 7' + ); + assert.equal( + moment(str, 'DD-MMM-YYYY', true).month(), + 7, + '02-ago-2016 strict parse month should be 7' ); }); @@ -31864,7 +33596,7 @@ defineCommonLocaleTests(name); } - localeModule('es-do'); + localeModule('es-mx'); test('parse', function (assert) { var tests = 'enero ene._febrero feb._marzo mar._abril abr._mayo may._junio jun._julio jul._agosto ago._septiembre sep._octubre oct._noviembre nov._diciembre dic.'.split( @@ -31919,7 +33651,7 @@ ['D Do DD', '14 14º 14'], ['d do dddd ddd dd', '0 0º domingo dom. do'], ['DDD DDDo DDDD', '45 45º 045'], - ['w wo ww', '6 6º 06'], + ['w wo ww', '7 7º 07'], ['YYYY-MMM-DD', '2010-feb-14'], ['h hh', '3 03'], ['H HH', '15 15'], @@ -31927,15 +33659,15 @@ ['s ss', '50 50'], ['a A', 'pm PM'], ['[the] DDDo [day of the year]', 'the 45º day of the year'], - ['LTS', '3:25:50 PM'], + ['LTS', '15:25:50'], ['L', '14/02/2010'], ['LL', '14 de febrero de 2010'], - ['LLL', '14 de febrero de 2010 3:25 PM'], - ['LLLL', 'domingo, 14 de febrero de 2010 3:25 PM'], + ['LLL', '14 de febrero de 2010 15:25'], + ['LLLL', 'domingo, 14 de febrero de 2010 15:25'], ['l', '14/2/2010'], ['ll', '14 de feb. de 2010'], - ['lll', '14 de feb. de 2010 3:25 PM'], - ['llll', 'dom., 14 de feb. de 2010 3:25 PM'], + ['lll', '14 de feb. de 2010 15:25'], + ['llll', 'dom., 14 de feb. de 2010 15:25'], ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -32180,37 +33912,37 @@ assert.equal( moment(a).calendar(), - 'hoy a las 12:00 PM', + 'hoy a las 12:00', 'today at the same time' ); assert.equal( moment(a).add({ m: 25 }).calendar(), - 'hoy a las 12:25 PM', + 'hoy a las 12:25', 'Now plus 25 min' ); assert.equal( moment(a).add({ h: 1 }).calendar(), - 'hoy a las 1:00 PM', + 'hoy a las 13:00', 'Now plus 1 hour' ); assert.equal( moment(a).add({ d: 1 }).calendar(), - 'mañana a las 12:00 PM', + 'mañana a las 12:00', 'tomorrow at the same time' ); assert.equal( moment(a).add({ d: 1, h: -1 }).calendar(), - 'mañana a las 11:00 AM', + 'mañana a las 11:00', 'tomorrow minus 1 hour' ); assert.equal( moment(a).subtract({ h: 1 }).calendar(), - 'hoy a las 11:00 AM', + 'hoy a las 11:00', 'Now minus 1 hour' ); assert.equal( moment(a).subtract({ d: 1 }).calendar(), - 'ayer a las 12:00 PM', + 'ayer a las 12:00', 'yesterday at the same time' ); }); @@ -32296,8 +34028,8 @@ test('weeks year starting sunday formatted', function (assert) { assert.equal( moment([2012, 0, 1]).format('w ww wo'), - '52 52 52º', - 'Jan 1 2012 should be week 52' + '1 01 1º', + 'Jan 1 2012 should be week 1' ); assert.equal( moment([2012, 0, 2]).format('w ww wo'), @@ -32306,8 +34038,8 @@ ); assert.equal( moment([2012, 0, 8]).format('w ww wo'), - '1 01 1º', - 'Jan 8 2012 should be week 1' + '2 02 2º', + 'Jan 8 2012 should be week 2' ); assert.equal( moment([2012, 0, 9]).format('w ww wo'), @@ -32316,22 +34048,63 @@ ); assert.equal( moment([2012, 0, 15]).format('w ww wo'), - '2 02 2º', - 'Jan 15 2012 should be week 2' + '3 03 3º', + 'Jan 15 2012 should be week 3' + ); + }); + + // Concrete test for Locale#weekdaysMin + test('Weekdays sort by locale', function (assert) { + const weekdays = 'domingo_lunes_martes_miércoles_jueves_viernes_sábado', + weekdaysShort = 'dom._lun._mar._mié._jue._vie._sáb.', + weekdaysMin = 'do_lu_ma_mi_ju_vi_sá'; + + assert.deepEqual( + moment().localeData().weekdays(), + weekdays.split('_'), + 'weekdays start on Sunday' + ); + assert.deepEqual( + moment().localeData().weekdays(true), + weekdays.split('_'), + 'locale-sorted weekdays start on Sunday' + ); + assert.deepEqual( + moment().localeData().weekdaysShort(), + weekdaysShort.split('_'), + 'weekdaysShort start on Sunday' + ); + assert.deepEqual( + moment().localeData().weekdaysShort(true), + weekdaysShort.split('_'), + 'locale-sorted weekdaysShort start on Sunday' + ); + assert.deepEqual( + moment().localeData().weekdaysMin(), + weekdaysMin.split('_'), + 'weekdaysMin start on Sunday' + ); + assert.deepEqual( + moment().localeData().weekdaysMin(true), + weekdaysMin.split('_'), + 'locale-sorted weekdaysMin start on Sunday' ); }); test('test short months proper', function (assert) { - var str = '02-ago-2016'; // "02-ago-2016" + var str = '02-ago-2016'; assert.equal( moment(str, 'DD-MMM-YYYY').month(), - 7, + '7', '02-ago-2016 month should be 7' ); + }); + + test('translated invalid date', function (assert) { assert.equal( - moment(str, 'DD-MMM-YYYY', true).month(), - 7, - '02-ago-2016 strict parse month should be 7' + moment('nonsense', 'DD-MMM-YYYY').format(), + 'Fecha inválida', + 'Invalid date should translate' ); }); @@ -50789,7 +52562,7 @@ localeModule('hu'); test('parse', function (assert) { - var tests = 'január jan_február feb_március márc_április ápr_május máj_június jún_július júl_augusztus aug_szeptember szept_október okt_november nov_december dec'.split( + var tests = 'január jan._február feb._március márc._április ápr._május máj._június jún._július júl._augusztus aug._szeptember szept._október okt._november nov._december dec.'.split( '_' ), i; @@ -50836,7 +52609,7 @@ 'vasárnap, február 14. 2010, 15:25:50', ], ['ddd, HH', 'vas, 15'], - ['M Mo MM MMMM MMM', '2 2. 02 február feb'], + ['M Mo MM MMMM MMM', '2 2. 02 február feb.'], ['YYYY YY', '2010 10'], ['D Do DD', '14 14. 14'], ['d do dddd ddd dd', '0 0. vasárnap vas v'], @@ -50852,9 +52625,9 @@ ['LLL', '2010. február 14. 15:25'], ['LLLL', '2010. február 14., vasárnap 15:25'], ['l', '2010.2.14.'], - ['ll', '2010. feb 14.'], - ['lll', '2010. feb 14. 15:25'], - ['llll', '2010. feb 14., vas 15:25'], + ['ll', '2010. feb. 14.'], + ['lll', '2010. feb. 14. 15:25'], + ['llll', '2010. feb. 14., vas 15:25'], ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -50913,7 +52686,7 @@ }); test('format month', function (assert) { - var expected = 'január jan_február feb_március márc_április ápr_május máj_június jún_július júl_augusztus aug_szeptember szept_október okt_november nov_december dec'.split( + var expected = 'január jan._február feb._március márc._április ápr._május máj._június jún._július júl._augusztus aug._szeptember szept._október okt._november nov._december dec.'.split( '_' ), i; @@ -82465,6 +84238,23 @@ localeModule('pl'); + test('months', function (assert) { + assert.deepEqual(moment.months(), [ + 'styczeń', + 'luty', + 'marzec', + 'kwiecień', + 'maj', + 'czerwiec', + 'lipiec', + 'sierpień', + 'wrzesień', + 'październik', + 'listopad', + 'grudzień', + ]); + }); + test('parse', function (assert) { var tests = 'styczeń stycznia sty_luty lutego lut_marzec marca mar_kwiecień kwietnia kwi_maj maja maj_czerwiec czerwca cze_lipiec lipca lip_sierpień sierpnia sie_wrzesień września wrz_październik października paź_listopad listopada lis_grudzień grudnia gru'.split( '_' @@ -92727,14 +94517,14 @@ ['a A', 'pm PM'], ['[the] DDDo [day of the year]', 'the 45. day of the year'], ['LTS', '15:25:50'], - ['L', '14.02.2010'], - ['LL', '14. фебруар 2010'], - ['LLL', '14. фебруар 2010 15:25'], - ['LLLL', 'недеља, 14. фебруар 2010 15:25'], - ['l', '14.2.2010'], - ['ll', '14. феб. 2010'], - ['lll', '14. феб. 2010 15:25'], - ['llll', 'нед., 14. феб. 2010 15:25'], + ['L', '14. 2. 2010.'], + ['LL', '14. фебруар 2010.'], + ['LLL', '14. фебруар 2010. 15:25'], + ['LLLL', 'недеља, 14. фебруар 2010. 15:25'], + ['l', '14. 2. 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; @@ -93598,14 +95388,14 @@ ['a A', 'pm PM'], ['[the] DDDo [day of the year]', 'the 45. day of the year'], ['LTS', '15:25:50'], - ['L', '14.02.2010'], - ['LL', '14. februar 2010'], - ['LLL', '14. februar 2010 15:25'], - ['LLLL', 'nedelja, 14. februar 2010 15:25'], - ['l', '14.2.2010'], - ['ll', '14. feb. 2010'], - ['lll', '14. feb. 2010 15:25'], - ['llll', 'ned., 14. feb. 2010 15:25'], + ['L', '14. 2. 2010.'], + ['LL', '14. februar 2010.'], + ['LLL', '14. februar 2010. 15:25'], + ['LLLL', 'nedelja, 14. februar 2010. 15:25'], + ['l', '14. 2. 2010.'], + ['ll', '14. feb. 2010.'], + ['lll', '14. feb. 2010. 15:25'], + ['llll', 'ned., 14. feb. 2010. 15:25'], ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -99565,6 +101355,7 @@ '_' ), i; + function equalTest(input, mmm, i) { assert.equal( moment(input, mmm).month(), @@ -99605,7 +101396,7 @@ var a = [ [ 'dddd, Do MMMM YYYY, h:mm:ss', - 'якшанбе, 14-ум феврал 2010, 3:25:50', + 'якшанбе, 14-ум феврали 2010, 3:25:50', ], ['ddd, h A', 'яшб, 3 рӯз'], ['M Mo MM MMMM MMM', '2 2-юм 02 феврал фев'], @@ -99621,11 +101412,11 @@ ['a A', 'рӯз рӯз'], ['DDDo [рӯзи сол]', '45-ум рӯзи сол'], ['LTS', '15:25:50'], - ['L', '14/02/2010'], - ['LL', '14 феврал 2010'], - ['LLL', '14 феврал 2010 15:25'], - ['LLLL', 'якшанбе, 14 феврал 2010 15:25'], - ['l', '14/2/2010'], + ['L', '14.02.2010'], + ['LL', '14 феврали 2010'], + ['LLL', '14 феврали 2010 15:25'], + ['LLLL', 'якшанбе, 14 феврали 2010 15:25'], + ['l', '14.2.2010'], ['ll', '14 фев 2010'], ['lll', '14 фев 2010 15:25'], ['llll', 'яшб, 14 фев 2010 15:25'], @@ -99903,7 +101694,7 @@ ); assert.equal( moment(a).add({ d: 1 }).calendar(), - 'Пагоҳ соати 12:00', + 'Фардо соати 12:00', 'tomorrow at the same time' ); assert.equal( @@ -117812,6 +119603,34 @@ ); }); + test('defaulting to current date', function (assert) { + var a = moment().hours(13).minutes(23).seconds(45); + assert.equal(moment(a).calendar(), 'Today at 1:23 PM', 'should equate'); + }); + + test('calendar overload time - passing one parameter - a falsy value', function (assert) { + var a = moment().hours(13).minutes(23).seconds(45), + tests = [ + '', + 0, + -0, + // 0n, + false, + NaN, + null, + undefined, + ], + i; + + for (i = 0; i < tests.length; ++i) { + assert.equal( + moment(a).calendar(tests[i]), + 'Today at 1:23 PM', + 'should equate' + ); + } + }); + }))); @@ -121571,6 +123390,20 @@ module('days in month'); + test('days in month of all but february', function (assert) { + var days = [31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], + year, + month; + for (year = 1899; year < 2100; year++) { + for (month = 0; month < 12; month++) { + if (month != 1) { + assert.equal(moment([year, month]).daysInMonth(), days[month]); + assert.equal(daysInMonth(year, month), days[month]); + } + } + } + }); + test('days in month', function (assert) { each([31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], function (days, i) { var firstDay = moment([2012, i]), @@ -121612,6 +123445,10 @@ }); test('days in month with NaN inputs', function (assert) { + assert.ok( + isNaN(daysInMonth(NaN, NaN)), + 'year and month NaN inputs should return NaN' + ); assert.ok(isNaN(daysInMonth(2, NaN)), 'month NaN inputs should return NaN'); assert.ok(isNaN(daysInMonth(NaN, 0)), 'year NaN inputs should return NaN'); assert.ok( @@ -133937,6 +135774,201 @@ }); } + function isLeapYear(year) { + return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; + } + + module('is leap year'); + + test('leap years', function (assert) { + var tests = [ + { year: 1, expected: false, description: '1 was not a leap year' }, + { year: 4, expected: true, description: '4 was a leap year' }, + { year: 100, expected: false, description: '100 was not a leap year' }, + { year: 400, expected: true, description: '400 was a leap year' }, + { + year: 1700, + expected: false, + description: + '1700 was a leap year in the Julian calendar, but not Gregorian', + }, + { + year: 1900, + expected: false, + description: + '1900 was not a leap year, but this is a well known Microsoft Excel bug', + }, + { year: 1904, expected: true, description: '1904 was a leap year' }, + { year: 2000, expected: true, description: '2000 was a leap year' }, + { year: 2008, expected: true, description: '2008 was a leap year' }, + { + year: 2010, + expected: false, + description: '2010 was not a leap year', + }, + { year: 2024, expected: true, description: '2024 will be a leap year' }, + { year: 3448, expected: true, description: '3448 will be a leap year' }, + { year: 4000, expected: true, description: '4000 will be a leap year' }, + { + year: NaN, + expected: false, + description: + 'NaN returns false explicitly, as math operations on non-numbers yields NaN', + }, + { + year: '2000', + expected: true, + description: + 'The string literal "2000" yields true as it is parsed as the number 2000', + }, + { + year: Infinity, + expected: false, + description: + 'Non-finite years are technically not years and definitely not leap years', + }, + { + year: 3.14, + expected: false, + description: + 'Non-integer years are technically not years and definitely not leap years', + }, + { + year: 0, + expected: true, + description: + 'While unclear whether this case is exceptional, it is a leap year based on existing formula', + }, + { + year: -400, + expected: true, + description: + 'While unclear whether this case is exceptional, it is a leap year based on existing formula', + }, + { + year: {}, + expected: false, + description: 'Objects are not a number, so not a leap year', + }, + { + year: [], + expected: true, + description: + 'An empty array is equivalent to 0, which is a leap year', + }, + ]; + + each(tests, function (testCase) { + var actual = isLeapYear(testCase.year); + assert.equal(actual, testCase.expected, testCase.description); + }); + }); + +}))); + + + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : + typeof define === 'function' && define.amd ? define(['../../moment'], factory) : + factory(global.moment) +}(this, (function (moment) { 'use strict'; + + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function setupDeprecationHandler(test, moment, scope) { + test._expectedDeprecations = null; + test._observedDeprecations = null; + test._oldSupress = moment.suppressDeprecationWarnings; + moment.suppressDeprecationWarnings = true; + test.expectedDeprecations = function () { + test._expectedDeprecations = arguments; + test._observedDeprecations = []; + }; + moment.deprecationHandler = function (name, msg) { + var deprecationId = matchedDeprecation( + name, + msg, + test._expectedDeprecations + ); + if (deprecationId === -1) { + throw new Error( + 'Unexpected deprecation thrown name=' + name + ' msg=' + msg + ); + } + test._observedDeprecations[deprecationId] = 1; + }; + } + + function teardownDeprecationHandler(test, moment, scope) { + moment.suppressDeprecationWarnings = test._oldSupress; + + if (test._expectedDeprecations != null) { + var missedDeprecations = []; + each(test._expectedDeprecations, function (deprecationPattern, id) { + if (test._observedDeprecations[id] !== 1) { + missedDeprecations.push(deprecationPattern); + } + }); + if (missedDeprecations.length !== 0) { + throw new Error( + 'Expected deprecation warnings did not happen: ' + + missedDeprecations.join(' ') + ); + } + } + } + + function matchedDeprecation(name, msg, deprecations) { + if (deprecations == null) { + return -1; + } + for (var i = 0; i < deprecations.length; ++i) { + if (name != null && name === deprecations[i]) { + return i; + } + if ( + msg != null && + msg.substring(0, deprecations[i].length) === deprecations[i] + ) { + return i; + } + } + return -1; + } + + /*global QUnit:false*/ + + var test = QUnit.test, + only = QUnit.only; + + function module(name, lifecycle) { + QUnit.module(name, { + beforeEach: function () { + moment.locale('en'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + setupDeprecationHandler(test, moment); + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + afterEach: function () { + teardownDeprecationHandler(test, moment); + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + }, + }); + } + module('leap year'); test('leap year', function (assert) { @@ -137563,16 +139595,16 @@ } var symbolMap = { - '1': '!', - '2': '@', - '3': '#', - '4': '$', - '5': '%', - '6': '^', - '7': '&', - '8': '*', - '9': '(', - '0': ')', + 1: '!', + 2: '@', + 3: '#', + 4: '$', + 5: '%', + 6: '^', + 7: '&', + 8: '*', + 9: '(', + 0: ')', }, numberMap = { '!': '1', diff --git a/moment.js b/moment.js index 264930ddd..1f27b2cd2 100644 --- a/moment.js +++ b/moment.js @@ -1,5 +1,5 @@ //! moment.js -//! version : 2.28.0 +//! version : 2.29.0 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com @@ -3726,7 +3726,10 @@ function calendar$1(time, formats) { // Support for single parameter, formats only overload to the calendar function if (arguments.length === 1) { - if (isMomentInput(arguments[0])) { + if (!arguments[0]) { + time = undefined; + formats = undefined; + } else if (isMomentInput(arguments[0])) { time = arguments[0]; formats = undefined; } else if (isCalendarSpec(arguments[0])) { @@ -5618,7 +5621,7 @@ //! moment.js - hooks.version = '2.28.0'; + hooks.version = '2.29.0'; setHookCallback(createLocal);