summaryrefslogtreecommitdiffstats
path: root/js/vendor/momentjs/lang/uk.js
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-03-14 10:22:09 +0100
committerBernhard Posselt <dev@bernhard-posselt.com>2014-03-26 01:34:31 +0100
commit2fc5ca4f601174a7ecb7c77a7059f5fac2ab4611 (patch)
treeaa7ab66e29fc7de98533d1e55832ca4fbcd39611 /js/vendor/momentjs/lang/uk.js
parent22fc777ce7403d706649cf83bb23010dfd7dea04 (diff)
update a lot of stuff, WIP
Diffstat (limited to 'js/vendor/momentjs/lang/uk.js')
-rw-r--r--js/vendor/momentjs/lang/uk.js251
1 files changed, 138 insertions, 113 deletions
diff --git a/js/vendor/momentjs/lang/uk.js b/js/vendor/momentjs/lang/uk.js
index 6275411ed..47056cb64 100644
--- a/js/vendor/momentjs/lang/uk.js
+++ b/js/vendor/momentjs/lang/uk.js
@@ -3,130 +3,155 @@
// author : zemlanin : https://github.com/zemlanin
// Author : Menelion Elensúle : https://github.com/Oire
-function plural(word, num) {
- var forms = word.split('_');
- 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]);
-}
-
-function relativeTimeWithPlural(number, withoutSuffix, key) {
- var format = {
- 'mm': 'хвилина_хвилини_хвилин',
- 'hh': 'година_години_годин',
- 'dd': 'день_дні_днів',
- 'MM': 'місяць_місяці_місяців',
- 'yy': 'рік_роки_років'
- };
- if (key === 'm') {
- return withoutSuffix ? 'хвилина' : 'хвилину';
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['moment'], factory); // AMD
+ } else if (typeof exports === 'object') {
+ module.exports = factory(require('../moment')); // Node
+ } else {
+ factory(window.moment); // Browser global
}
- else if (key === 'h') {
- return withoutSuffix ? 'година' : 'годину';
+}(function (moment) {
+ function plural(word, num) {
+ var forms = word.split('_');
+ 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]);
}
- else {
- return number + ' ' + plural(format[key], +number);
+
+ function relativeTimeWithPlural(number, withoutSuffix, key) {
+ var format = {
+ 'mm': 'хвилина_хвилини_хвилин',
+ 'hh': 'година_години_годин',
+ 'dd': 'день_дні_днів',
+ 'MM': 'місяць_місяці_місяців',
+ 'yy': 'рік_роки_років'
+ };
+ if (key === 'm') {
+ return withoutSuffix ? 'хвилина' : 'хвилину';
+ }
+ else if (key === 'h') {
+ return withoutSuffix ? 'година' : 'годину';
+ }
+ else {
+ return number + ' ' + plural(format[key], +number);
+ }
}
-}
-function monthsCaseReplace(m, format) {
- var months = {
- 'nominative': 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split('_'),
- 'accusative': 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split('_')
- },
+ function monthsCaseReplace(m, format) {
+ var months = {
+ 'nominative': 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split('_'),
+ 'accusative': 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split('_')
+ },
- nounCase = (/D[oD]? *MMMM?/).test(format) ?
- 'accusative' :
- 'nominative';
+ nounCase = (/D[oD]? *MMMM?/).test(format) ?
+ 'accusative' :
+ 'nominative';
- return months[nounCase][m.month()];
-}
+ return months[nounCase][m.month()];
+ }
-function weekdaysCaseReplace(m, format) {
- var weekdays = {
- 'nominative': 'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split('_'),
- 'accusative': 'неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу'.split('_'),
- 'genitive': 'неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи'.split('_')
- },
+ function weekdaysCaseReplace(m, format) {
+ var weekdays = {
+ 'nominative': 'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split('_'),
+ 'accusative': 'неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу'.split('_'),
+ 'genitive': 'неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи'.split('_')
+ },
- nounCase = (/(\[[ВвУу]\]) ?dddd/).test(format) ?
- 'accusative' :
- ((/\[?(?:минулої|наступної)? ?\] ?dddd/).test(format) ?
- 'genitive' :
- 'nominative');
+ nounCase = (/(\[[ВвУу]\]) ?dddd/).test(format) ?
+ 'accusative' :
+ ((/\[?(?:минулої|наступної)? ?\] ?dddd/).test(format) ?
+ 'genitive' :
+ 'nominative');
- return weekdays[nounCase][m.day()];
-}
+ return weekdays[nounCase][m.day()];
+ }
-function processHoursFunction(str) {
- return function () {
- return str + 'о' + (this.hours() === 11 ? 'б' : '') + '] LT';
- };
-}
+ function processHoursFunction(str) {
+ return function () {
+ return str + 'о' + (this.hours() === 11 ? 'б' : '') + '] LT';
+ };
+ }
-require('../moment').lang('uk', {
- months : monthsCaseReplace,
- monthsShort : "січ_лют_бер_кві_тра_чер_лип_сер_вер_жов_лис_гру".split("_"),
- weekdays : weekdaysCaseReplace,
- weekdaysShort : "нед_пон_вів_срд_чет_птн_суб".split("_"),
- weekdaysMin : "нд_пн_вт_ср_чт_пт_сб".split("_"),
- longDateFormat : {
- LT : "HH:mm",
- L : "DD.MM.YYYY",
- LL : "D MMMM YYYY р.",
- LLL : "D MMMM YYYY р., LT",
- LLLL : "dddd, D MMMM YYYY р., LT"
- },
- calendar : {
- 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);
+ return moment.lang('uk', {
+ months : monthsCaseReplace,
+ monthsShort : "січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),
+ weekdays : weekdaysCaseReplace,
+ weekdaysShort : "нд_пн_вт_ср_чт_пт_сб".split("_"),
+ weekdaysMin : "нд_пн_вт_ср_чт_пт_сб".split("_"),
+ longDateFormat : {
+ LT : "HH:mm",
+ L : "DD.MM.YYYY",
+ LL : "D MMMM YYYY р.",
+ LLL : "D MMMM YYYY р., LT",
+ LLLL : "dddd, D MMMM YYYY р., LT"
+ },
+ calendar : {
+ 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);
+ }
+ },
+ sameElse: 'L'
+ },
+ relativeTime : {
+ future : "за %s",
+ past : "%s тому",
+ s : "декілька секунд",
+ m : relativeTimeWithPlural,
+ mm : relativeTimeWithPlural,
+ h : "годину",
+ hh : relativeTimeWithPlural,
+ d : "день",
+ dd : relativeTimeWithPlural,
+ M : "місяць",
+ MM : relativeTimeWithPlural,
+ y : "рік",
+ yy : relativeTimeWithPlural
+ },
+
+ // M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason
+
+ meridiem : function (hour, minute, isLower) {
+ if (hour < 4) {
+ return "ночі";
+ } else if (hour < 12) {
+ return "ранку";
+ } else if (hour < 17) {
+ return "дня";
+ } else {
+ return "вечора";
}
},
- sameElse: 'L'
- },
- relativeTime : {
- future : "за %s",
- past : "%s тому",
- s : "декілька секунд",
- m : relativeTimeWithPlural,
- mm : relativeTimeWithPlural,
- h : "годину",
- hh : relativeTimeWithPlural,
- d : "день",
- dd : relativeTimeWithPlural,
- M : "місяць",
- MM : relativeTimeWithPlural,
- y : "рік",
- yy : relativeTimeWithPlural
- },
- 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;
- }
- },
- week : {
- dow : 1, // Monday is the first day of the week.
- doy : 7 // The week that contains Jan 1st is the first week of the year.
- }
-});
+ 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;
+ }
+ },
+
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 7 // The week that contains Jan 1st is the first week of the year.
+ }
+ });
+}));