2016-02-05 15:42:48 -05:00
|
|
|
|
//! moment.js locale configuration
|
2020-11-10 20:34:26 -05:00
|
|
|
|
//! locale : Ukrainian [uk]
|
|
|
|
|
//! author : zemlanin : https://github.com/zemlanin
|
|
|
|
|
//! Author : Menelion Elensúle : https://github.com/Oire
|
2016-02-05 15:42:48 -05:00
|
|
|
|
|
|
|
|
|
;(function (global, factory) {
|
|
|
|
|
typeof exports === 'object' && typeof module !== 'undefined'
|
|
|
|
|
&& typeof require === 'function' ? factory(require('../moment')) :
|
2017-04-20 00:24:20 -04:00
|
|
|
|
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
|
2016-02-05 15:42:48 -05:00
|
|
|
|
factory(global.moment)
|
2017-04-20 00:24:20 -04:00
|
|
|
|
}(this, (function (moment) { 'use strict';
|
2016-02-05 15:42:48 -05:00
|
|
|
|
|
2020-11-10 20:34:26 -05:00
|
|
|
|
//! moment.js locale configuration
|
2014-04-09 15:10:19 -04:00
|
|
|
|
|
2018-04-26 03:15:53 -04:00
|
|
|
|
function plural(word, num) {
|
|
|
|
|
var forms = word.split('_');
|
2020-11-10 20:34:26 -05:00
|
|
|
|
return num % 10 === 1 && num % 100 !== 11
|
|
|
|
|
? forms[0]
|
|
|
|
|
: num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20)
|
2024-03-10 22:04:51 -04:00
|
|
|
|
? forms[1]
|
|
|
|
|
: forms[2];
|
2014-08-20 14:41:50 -04:00
|
|
|
|
}
|
2018-04-26 03:15:53 -04:00
|
|
|
|
function relativeTimeWithPlural(number, withoutSuffix, key) {
|
|
|
|
|
var format = {
|
2020-11-10 20:34:26 -05:00
|
|
|
|
ss: withoutSuffix ? 'секунда_секунди_секунд' : 'секунду_секунди_секунд',
|
|
|
|
|
mm: withoutSuffix ? 'хвилина_хвилини_хвилин' : 'хвилину_хвилини_хвилин',
|
|
|
|
|
hh: withoutSuffix ? 'година_години_годин' : 'годину_години_годин',
|
|
|
|
|
dd: 'день_дні_днів',
|
|
|
|
|
MM: 'місяць_місяці_місяців',
|
|
|
|
|
yy: 'рік_роки_років',
|
2018-04-26 03:15:53 -04:00
|
|
|
|
};
|
|
|
|
|
if (key === 'm') {
|
|
|
|
|
return withoutSuffix ? 'хвилина' : 'хвилину';
|
2020-11-10 20:34:26 -05:00
|
|
|
|
} else if (key === 'h') {
|
2018-04-26 03:15:53 -04:00
|
|
|
|
return withoutSuffix ? 'година' : 'годину';
|
2020-11-10 20:34:26 -05:00
|
|
|
|
} else {
|
2018-04-26 03:15:53 -04:00
|
|
|
|
return number + ' ' + plural(format[key], +number);
|
|
|
|
|
}
|
2014-08-20 14:41:50 -04:00
|
|
|
|
}
|
2018-04-26 03:15:53 -04:00
|
|
|
|
function weekdaysCaseReplace(m, format) {
|
|
|
|
|
var weekdays = {
|
2022-04-11 13:27:24 -04:00
|
|
|
|
nominative:
|
|
|
|
|
'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split(
|
|
|
|
|
'_'
|
|
|
|
|
),
|
|
|
|
|
accusative:
|
|
|
|
|
'неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу'.split(
|
|
|
|
|
'_'
|
|
|
|
|
),
|
|
|
|
|
genitive:
|
|
|
|
|
'неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи'.split(
|
|
|
|
|
'_'
|
|
|
|
|
),
|
2020-11-10 20:34:26 -05:00
|
|
|
|
},
|
|
|
|
|
nounCase;
|
2017-04-20 00:24:20 -04:00
|
|
|
|
|
2019-04-26 09:00:57 -04:00
|
|
|
|
if (m === true) {
|
2020-11-10 20:34:26 -05:00
|
|
|
|
return weekdays['nominative']
|
|
|
|
|
.slice(1, 7)
|
|
|
|
|
.concat(weekdays['nominative'].slice(0, 1));
|
2019-04-26 09:00:57 -04:00
|
|
|
|
}
|
2018-04-26 03:15:53 -04:00
|
|
|
|
if (!m) {
|
|
|
|
|
return weekdays['nominative'];
|
|
|
|
|
}
|
2014-04-09 15:10:19 -04:00
|
|
|
|
|
2020-11-10 20:34:26 -05:00
|
|
|
|
nounCase = /(\[[ВвУу]\]) ?dddd/.test(format)
|
|
|
|
|
? 'accusative'
|
|
|
|
|
: /\[?(?:минулої|наступної)? ?\] ?dddd/.test(format)
|
2024-03-10 22:04:51 -04:00
|
|
|
|
? 'genitive'
|
|
|
|
|
: 'nominative';
|
2018-04-26 03:15:53 -04:00
|
|
|
|
return weekdays[nounCase][m.day()];
|
|
|
|
|
}
|
|
|
|
|
function processHoursFunction(str) {
|
|
|
|
|
return function () {
|
|
|
|
|
return str + 'о' + (this.hours() === 11 ? 'б' : '') + '] LT';
|
|
|
|
|
};
|
|
|
|
|
}
|
2017-04-20 00:24:20 -04:00
|
|
|
|
|
2018-04-26 03:15:53 -04:00
|
|
|
|
var uk = moment.defineLocale('uk', {
|
2020-11-10 20:34:26 -05:00
|
|
|
|
months: {
|
|
|
|
|
format: 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split(
|
|
|
|
|
'_'
|
|
|
|
|
),
|
2022-04-11 13:27:24 -04:00
|
|
|
|
standalone:
|
|
|
|
|
'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split(
|
|
|
|
|
'_'
|
|
|
|
|
),
|
2018-04-26 03:15:53 -04:00
|
|
|
|
},
|
2020-11-10 20:34:26 -05:00
|
|
|
|
monthsShort: 'січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд'.split(
|
|
|
|
|
'_'
|
|
|
|
|
),
|
|
|
|
|
weekdays: weekdaysCaseReplace,
|
|
|
|
|
weekdaysShort: 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
|
|
|
|
|
weekdaysMin: 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
|
|
|
|
|
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',
|
2018-04-26 03:15:53 -04:00
|
|
|
|
},
|
2020-11-10 20:34:26 -05:00
|
|
|
|
calendar: {
|
2018-04-26 03:15:53 -04:00
|
|
|
|
sameDay: processHoursFunction('[Сьогодні '),
|
|
|
|
|
nextDay: processHoursFunction('[Завтра '),
|
|
|
|
|
lastDay: processHoursFunction('[Вчора '),
|
|
|
|
|
nextWeek: processHoursFunction('[У] dddd ['),
|
|
|
|
|
lastWeek: function () {
|
|
|
|
|
switch (this.day()) {
|
|
|
|
|
case 0:
|
|
|
|
|
case 3:
|
|
|
|
|
case 5:
|
|
|
|
|
case 6:
|
|
|
|
|
return processHoursFunction('[Минулої] dddd [').call(this);
|
|
|
|
|
case 1:
|
|
|
|
|
case 2:
|
|
|
|
|
case 4:
|
|
|
|
|
return processHoursFunction('[Минулого] dddd [').call(this);
|
|
|
|
|
}
|
|
|
|
|
},
|
2020-11-10 20:34:26 -05:00
|
|
|
|
sameElse: 'L',
|
2018-04-26 03:15:53 -04:00
|
|
|
|
},
|
2020-11-10 20:34:26 -05:00
|
|
|
|
relativeTime: {
|
|
|
|
|
future: 'за %s',
|
|
|
|
|
past: '%s тому',
|
|
|
|
|
s: 'декілька секунд',
|
|
|
|
|
ss: relativeTimeWithPlural,
|
|
|
|
|
m: relativeTimeWithPlural,
|
|
|
|
|
mm: relativeTimeWithPlural,
|
|
|
|
|
h: 'годину',
|
|
|
|
|
hh: relativeTimeWithPlural,
|
|
|
|
|
d: 'день',
|
|
|
|
|
dd: relativeTimeWithPlural,
|
|
|
|
|
M: 'місяць',
|
|
|
|
|
MM: relativeTimeWithPlural,
|
|
|
|
|
y: 'рік',
|
|
|
|
|
yy: relativeTimeWithPlural,
|
2018-04-26 03:15:53 -04:00
|
|
|
|
},
|
|
|
|
|
// M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason
|
|
|
|
|
meridiemParse: /ночі|ранку|дня|вечора/,
|
|
|
|
|
isPM: function (input) {
|
|
|
|
|
return /^(дня|вечора)$/.test(input);
|
|
|
|
|
},
|
2020-11-10 20:34:26 -05:00
|
|
|
|
meridiem: function (hour, minute, isLower) {
|
2018-04-26 03:15:53 -04:00
|
|
|
|
if (hour < 4) {
|
|
|
|
|
return 'ночі';
|
|
|
|
|
} else if (hour < 12) {
|
|
|
|
|
return 'ранку';
|
|
|
|
|
} else if (hour < 17) {
|
|
|
|
|
return 'дня';
|
|
|
|
|
} else {
|
|
|
|
|
return 'вечора';
|
2014-08-20 14:41:50 -04:00
|
|
|
|
}
|
2014-04-09 15:10:19 -04:00
|
|
|
|
},
|
2018-04-26 03:15:53 -04:00
|
|
|
|
dayOfMonthOrdinalParse: /\d{1,2}-(й|го)/,
|
|
|
|
|
ordinal: function (number, period) {
|
|
|
|
|
switch (period) {
|
|
|
|
|
case 'M':
|
|
|
|
|
case 'd':
|
|
|
|
|
case 'DDD':
|
|
|
|
|
case 'w':
|
|
|
|
|
case 'W':
|
|
|
|
|
return number + '-й';
|
|
|
|
|
case 'D':
|
|
|
|
|
return number + '-го';
|
|
|
|
|
default:
|
|
|
|
|
return number;
|
|
|
|
|
}
|
|
|
|
|
},
|
2020-11-10 20:34:26 -05:00
|
|
|
|
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.
|
|
|
|
|
},
|
2018-04-26 03:15:53 -04:00
|
|
|
|
});
|
2016-02-05 15:42:48 -05:00
|
|
|
|
|
2018-04-26 03:15:53 -04:00
|
|
|
|
return uk;
|
2016-02-05 15:42:48 -05:00
|
|
|
|
|
2017-04-20 00:24:20 -04:00
|
|
|
|
})));
|