Merge "Improve docs for Title::getInternalURL/getCanonicalURL"
[lhc/web/wiklou.git] / resources / lib / moment / locale / uk.js
1 //! moment.js locale configuration
2
3 ;(function (global, factory) {
4 typeof exports === 'object' && typeof module !== 'undefined'
5 && typeof require === 'function' ? factory(require('../moment')) :
6 typeof define === 'function' && define.amd ? define(['../moment'], factory) :
7 factory(global.moment)
8 }(this, (function (moment) { 'use strict';
9
10
11 function plural(word, num) {
12 var forms = word.split('_');
13 return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);
14 }
15 function relativeTimeWithPlural(number, withoutSuffix, key) {
16 var format = {
17 'ss': withoutSuffix ? 'секунда_секунди_секунд' : 'секунду_секунди_секунд',
18 'mm': withoutSuffix ? 'хвилина_хвилини_хвилин' : 'хвилину_хвилини_хвилин',
19 'hh': withoutSuffix ? 'година_години_годин' : 'годину_години_годин',
20 'dd': 'день_дні_днів',
21 'MM': 'місяць_місяці_місяців',
22 'yy': 'рік_роки_років'
23 };
24 if (key === 'm') {
25 return withoutSuffix ? 'хвилина' : 'хвилину';
26 }
27 else if (key === 'h') {
28 return withoutSuffix ? 'година' : 'годину';
29 }
30 else {
31 return number + ' ' + plural(format[key], +number);
32 }
33 }
34 function weekdaysCaseReplace(m, format) {
35 var weekdays = {
36 'nominative': 'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split('_'),
37 'accusative': 'неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу'.split('_'),
38 'genitive': 'неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи'.split('_')
39 };
40
41 if (m === true) {
42 return weekdays['nominative'].slice(1, 7).concat(weekdays['nominative'].slice(0, 1));
43 }
44 if (!m) {
45 return weekdays['nominative'];
46 }
47
48 var nounCase = (/(\[[ВвУу]\]) ?dddd/).test(format) ?
49 'accusative' :
50 ((/\[?(?:минулої|наступної)? ?\] ?dddd/).test(format) ?
51 'genitive' :
52 'nominative');
53 return weekdays[nounCase][m.day()];
54 }
55 function processHoursFunction(str) {
56 return function () {
57 return str + 'о' + (this.hours() === 11 ? 'б' : '') + '] LT';
58 };
59 }
60
61 var uk = moment.defineLocale('uk', {
62 months : {
63 'format': 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split('_'),
64 'standalone': 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split('_')
65 },
66 monthsShort : 'січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд'.split('_'),
67 weekdays : weekdaysCaseReplace,
68 weekdaysShort : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
69 weekdaysMin : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
70 longDateFormat : {
71 LT : 'HH:mm',
72 LTS : 'HH:mm:ss',
73 L : 'DD.MM.YYYY',
74 LL : 'D MMMM YYYY р.',
75 LLL : 'D MMMM YYYY р., HH:mm',
76 LLLL : 'dddd, D MMMM YYYY р., HH:mm'
77 },
78 calendar : {
79 sameDay: processHoursFunction('[Сьогодні '),
80 nextDay: processHoursFunction('[Завтра '),
81 lastDay: processHoursFunction('[Вчора '),
82 nextWeek: processHoursFunction('[У] dddd ['),
83 lastWeek: function () {
84 switch (this.day()) {
85 case 0:
86 case 3:
87 case 5:
88 case 6:
89 return processHoursFunction('[Минулої] dddd [').call(this);
90 case 1:
91 case 2:
92 case 4:
93 return processHoursFunction('[Минулого] dddd [').call(this);
94 }
95 },
96 sameElse: 'L'
97 },
98 relativeTime : {
99 future : 'за %s',
100 past : '%s тому',
101 s : 'декілька секунд',
102 ss : relativeTimeWithPlural,
103 m : relativeTimeWithPlural,
104 mm : relativeTimeWithPlural,
105 h : 'годину',
106 hh : relativeTimeWithPlural,
107 d : 'день',
108 dd : relativeTimeWithPlural,
109 M : 'місяць',
110 MM : relativeTimeWithPlural,
111 y : 'рік',
112 yy : relativeTimeWithPlural
113 },
114 // M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason
115 meridiemParse: /ночі|ранку|дня|вечора/,
116 isPM: function (input) {
117 return /^(дня|вечора)$/.test(input);
118 },
119 meridiem : function (hour, minute, isLower) {
120 if (hour < 4) {
121 return 'ночі';
122 } else if (hour < 12) {
123 return 'ранку';
124 } else if (hour < 17) {
125 return 'дня';
126 } else {
127 return 'вечора';
128 }
129 },
130 dayOfMonthOrdinalParse: /\d{1,2}-(й|го)/,
131 ordinal: function (number, period) {
132 switch (period) {
133 case 'M':
134 case 'd':
135 case 'DDD':
136 case 'w':
137 case 'W':
138 return number + '-й';
139 case 'D':
140 return number + '-го';
141 default:
142 return number;
143 }
144 },
145 week : {
146 dow : 1, // Monday is the first day of the week.
147 doy : 7 // The week that contains Jan 7th is the first week of the year.
148 }
149 });
150
151 return uk;
152
153 })));