Ensure users are able to edit the page after changing the content model
[lhc/web/wiklou.git] / resources / lib / moment / locale / lv.js
1 // moment.js locale configuration
2 // locale : latvian (lv)
3 // author : Kristaps Karlsons : https://github.com/skakri
4
5 (function (factory) {
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
10 } else {
11 factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
12 }
13 }(function (moment) {
14 var units = {
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'
20 };
21
22 function format(word, number, withoutSuffix) {
23 var forms = word.split('_');
24 if (withoutSuffix) {
25 return number % 10 === 1 && number !== 11 ? forms[2] : forms[3];
26 } else {
27 return number % 10 === 1 && number !== 11 ? forms[0] : forms[1];
28 }
29 }
30
31 function relativeTimeWithPlural(number, withoutSuffix, key) {
32 return number + ' ' + format(units[key], number, withoutSuffix);
33 }
34
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('_'),
41 longDateFormat : {
42 LT : 'HH:mm',
43 LTS : 'LT:ss',
44 L : 'DD.MM.YYYY',
45 LL : 'YYYY. [gada] D. MMMM',
46 LLL : 'YYYY. [gada] D. MMMM, LT',
47 LLLL : 'YYYY. [gada] D. MMMM, dddd, LT'
48 },
49 calendar : {
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',
55 sameElse : 'L'
56 },
57 relativeTime : {
58 future : '%s vēlāk',
59 past : '%s agrāk',
60 s : 'dažas sekundes',
61 m : 'minūti',
62 mm : relativeTimeWithPlural,
63 h : 'stundu',
64 hh : relativeTimeWithPlural,
65 d : 'dienu',
66 dd : relativeTimeWithPlural,
67 M : 'mēnesi',
68 MM : relativeTimeWithPlural,
69 y : 'gadu',
70 yy : relativeTimeWithPlural
71 },
72 ordinalParse: /\d{1,2}\./,
73 ordinal : '%d.',
74 week : {
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.
77 }
78 });
79 }));