1 // moment.js locale configuration
2 // locale : latvian (lv)
3 // author : Kristaps Karlsons : https://github.com/skakri
6 if (typeof define === 'function' && define.amd) {
7 define(['moment'], factory); // AMD
8 } else if (typeof exports === 'object') {
9 module.exports = factory(require('../moment')); // Node
11 factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
15 'mm': 'minūti_minūtes_minūte_minūtes',
16 'hh': 'stundu_stundas_stunda_stundas',
17 'dd': 'dienu_dienas_diena_dienas',
18 'MM': 'mēnesi_mēnešus_mēnesis_mēneši',
19 'yy': 'gadu_gadus_gads_gadi'
22 function format(word, number, withoutSuffix) {
23 var forms = word.split('_');
25 return number % 10 === 1 && number !== 11 ? forms[2] : forms[3];
27 return number % 10 === 1 && number !== 11 ? forms[0] : forms[1];
31 function relativeTimeWithPlural(number, withoutSuffix, key) {
32 return number + ' ' + format(units[key], number, withoutSuffix);
35 return moment.defineLocale('lv', {
36 months : 'janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris'.split('_'),
37 monthsShort : 'jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec'.split('_'),
38 weekdays : 'svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena'.split('_'),
39 weekdaysShort : 'Sv_P_O_T_C_Pk_S'.split('_'),
40 weekdaysMin : 'Sv_P_O_T_C_Pk_S'.split('_'),
45 LL : 'YYYY. [gada] D. MMMM',
46 LLL : 'YYYY. [gada] D. MMMM, LT',
47 LLLL : 'YYYY. [gada] D. MMMM, dddd, LT'
50 sameDay : '[Šodien pulksten] LT',
51 nextDay : '[Rīt pulksten] LT',
52 nextWeek : 'dddd [pulksten] LT',
53 lastDay : '[Vakar pulksten] LT',
54 lastWeek : '[Pagājušā] dddd [pulksten] LT',
62 mm : relativeTimeWithPlural,
64 hh : relativeTimeWithPlural,
66 dd : relativeTimeWithPlural,
68 MM : relativeTimeWithPlural,
70 yy : relativeTimeWithPlural
72 ordinalParse: /\d{1,2}\./,
75 dow : 1, // Monday is the first day of the week.
76 doy : 4 // The week that contains Jan 4th is the first week of the year.