2016-04-01 05:33:25 +08:00
|
|
|
|
//! moment.js locale configuration
|
|
|
|
|
//! locale : russian (ru)
|
|
|
|
|
//! author : Viktorminator : https://github.com/Viktorminator
|
|
|
|
|
//! Author : Menelion Elensúle : https://github.com/Oire
|
|
|
|
|
|
|
|
|
|
;(function (global, factory) {
|
|
|
|
|
typeof exports === 'object' && typeof module !== 'undefined'
|
|
|
|
|
&& typeof require === 'function' ? factory(require('../moment')) :
|
|
|
|
|
typeof define === 'function' && define.amd ? define(['moment'], factory) :
|
|
|
|
|
factory(global.moment)
|
|
|
|
|
}(this, function (moment) { 'use strict';
|
|
|
|
|
|
2014-08-21 02:41:50 +08:00
|
|
|
|
|
|
|
|
|
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]);
|
2013-06-07 16:03:09 +08:00
|
|
|
|
}
|
2014-08-21 02:41:50 +08:00
|
|
|
|
function relativeTimeWithPlural(number, withoutSuffix, key) {
|
|
|
|
|
var format = {
|
|
|
|
|
'mm': withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут',
|
|
|
|
|
'hh': 'час_часа_часов',
|
|
|
|
|
'dd': 'день_дня_дней',
|
|
|
|
|
'MM': 'месяц_месяца_месяцев',
|
|
|
|
|
'yy': 'год_года_лет'
|
|
|
|
|
};
|
|
|
|
|
if (key === 'm') {
|
|
|
|
|
return withoutSuffix ? 'минута' : 'минуту';
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
return number + ' ' + plural(format[key], +number);
|
|
|
|
|
}
|
2013-06-07 16:03:09 +08:00
|
|
|
|
}
|
2016-04-01 05:33:25 +08:00
|
|
|
|
var monthsParse = [/^янв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[й|я]/i, /^июн/i, /^июл/i, /^авг/i, /^сен/i, /^окт/i, /^ноя/i, /^дек/i];
|
2014-08-21 02:41:50 +08:00
|
|
|
|
|
2016-04-01 05:33:25 +08:00
|
|
|
|
var ru = moment.defineLocale('ru', {
|
|
|
|
|
months : {
|
|
|
|
|
format: 'Января_Февраля_Марта_Апреля_Мая_Июня_Июля_Августа_Сентября_Октября_Ноября_Декабря'.split('_'),
|
|
|
|
|
standalone: 'Январь_Февраль_Март_Апрель_Май_Июнь_Июль_Август_Сентябрь_Октябрь_Ноябрь_Декабрь'.split('_')
|
2013-06-07 16:03:09 +08:00
|
|
|
|
},
|
2016-04-01 05:33:25 +08:00
|
|
|
|
monthsShort : {
|
|
|
|
|
format: 'янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек'.split('_'),
|
|
|
|
|
standalone: 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_')
|
2014-08-21 02:41:50 +08:00
|
|
|
|
},
|
2016-04-01 05:33:25 +08:00
|
|
|
|
weekdays : {
|
|
|
|
|
standalone: 'Воскресенье_Понедельник_Вторник_Среда_Четверг_Пятница_Суббота'.split('_'),
|
|
|
|
|
format: 'Воскресенье_Понедельник_Вторник_Среду_Четверг_Пятницу_Субботу'.split('_'),
|
|
|
|
|
isFormat: /\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/
|
2013-06-07 16:03:09 +08:00
|
|
|
|
},
|
2016-04-01 05:33:25 +08:00
|
|
|
|
weekdaysShort : 'Вс_Пн_Вт_Ср_Чт_Пт_Сб'.split('_'),
|
|
|
|
|
weekdaysMin : 'Вс_Пн_Вт_Ср_Чт_Пт_Сб'.split('_'),
|
|
|
|
|
monthsParse : monthsParse,
|
|
|
|
|
longMonthsParse : monthsParse,
|
|
|
|
|
shortMonthsParse : monthsParse,
|
2014-08-21 02:41:50 +08:00
|
|
|
|
longDateFormat : {
|
2016-04-01 05:33:25 +08:00
|
|
|
|
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'
|
2014-08-21 02:41:50 +08:00
|
|
|
|
},
|
|
|
|
|
calendar : {
|
|
|
|
|
sameDay: '[Сегодня в] LT',
|
|
|
|
|
nextDay: '[Завтра в] LT',
|
|
|
|
|
lastDay: '[Вчера в] LT',
|
2016-04-01 05:33:25 +08:00
|
|
|
|
nextWeek: function (now) {
|
|
|
|
|
if (now.week() !== this.week()) {
|
|
|
|
|
switch (this.day()) {
|
|
|
|
|
case 0:
|
|
|
|
|
return '[В следующее] dddd [в] LT';
|
|
|
|
|
case 1:
|
|
|
|
|
case 2:
|
|
|
|
|
case 4:
|
|
|
|
|
return '[В следующий] dddd [в] LT';
|
|
|
|
|
case 3:
|
|
|
|
|
case 5:
|
|
|
|
|
case 6:
|
|
|
|
|
return '[В следующую] dddd [в] LT';
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (this.day() === 2) {
|
|
|
|
|
return '[Во] dddd [в] LT';
|
|
|
|
|
} else {
|
|
|
|
|
return '[В] dddd [в] LT';
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-08-21 02:41:50 +08:00
|
|
|
|
},
|
2016-04-01 05:33:25 +08:00
|
|
|
|
lastWeek: function (now) {
|
|
|
|
|
if (now.week() !== this.week()) {
|
|
|
|
|
switch (this.day()) {
|
|
|
|
|
case 0:
|
|
|
|
|
return '[В прошлое] dddd [в] LT';
|
|
|
|
|
case 1:
|
|
|
|
|
case 2:
|
|
|
|
|
case 4:
|
|
|
|
|
return '[В прошлый] dddd [в] LT';
|
|
|
|
|
case 3:
|
|
|
|
|
case 5:
|
|
|
|
|
case 6:
|
|
|
|
|
return '[В прошлую] dddd [в] LT';
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (this.day() === 2) {
|
|
|
|
|
return '[Во] dddd [в] LT';
|
|
|
|
|
} else {
|
|
|
|
|
return '[В] dddd [в] LT';
|
|
|
|
|
}
|
2014-08-21 02:41:50 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
sameElse: 'L'
|
|
|
|
|
},
|
|
|
|
|
relativeTime : {
|
2016-04-01 05:33:25 +08:00
|
|
|
|
future : 'через %s',
|
|
|
|
|
past : '%s назад',
|
|
|
|
|
s : 'несколько секунд',
|
2014-08-21 02:41:50 +08:00
|
|
|
|
m : relativeTimeWithPlural,
|
|
|
|
|
mm : relativeTimeWithPlural,
|
2016-04-01 05:33:25 +08:00
|
|
|
|
h : 'час',
|
2014-08-21 02:41:50 +08:00
|
|
|
|
hh : relativeTimeWithPlural,
|
2016-04-01 05:33:25 +08:00
|
|
|
|
d : 'день',
|
2014-08-21 02:41:50 +08:00
|
|
|
|
dd : relativeTimeWithPlural,
|
2016-04-01 05:33:25 +08:00
|
|
|
|
M : 'месяц',
|
2014-08-21 02:41:50 +08:00
|
|
|
|
MM : relativeTimeWithPlural,
|
2016-04-01 05:33:25 +08:00
|
|
|
|
y : 'год',
|
2014-08-21 02:41:50 +08:00
|
|
|
|
yy : relativeTimeWithPlural
|
|
|
|
|
},
|
|
|
|
|
meridiemParse: /ночи|утра|дня|вечера/i,
|
|
|
|
|
isPM : function (input) {
|
|
|
|
|
return /^(дня|вечера)$/.test(input);
|
|
|
|
|
},
|
|
|
|
|
meridiem : function (hour, minute, isLower) {
|
|
|
|
|
if (hour < 4) {
|
2016-04-01 05:33:25 +08:00
|
|
|
|
return 'ночи';
|
2014-08-21 02:41:50 +08:00
|
|
|
|
} else if (hour < 12) {
|
2016-04-01 05:33:25 +08:00
|
|
|
|
return 'утра';
|
2014-08-21 02:41:50 +08:00
|
|
|
|
} else if (hour < 17) {
|
2016-04-01 05:33:25 +08:00
|
|
|
|
return 'дня';
|
2014-08-21 02:41:50 +08:00
|
|
|
|
} else {
|
2016-04-01 05:33:25 +08:00
|
|
|
|
return 'вечера';
|
2014-08-21 02:41:50 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
2016-04-01 05:33:25 +08:00
|
|
|
|
ordinalParse: /\d{1,2}-(й|го|я)/,
|
2014-08-21 02:41:50 +08:00
|
|
|
|
ordinal: function (number, period) {
|
|
|
|
|
switch (period) {
|
|
|
|
|
case 'M':
|
|
|
|
|
case 'd':
|
|
|
|
|
case 'DDD':
|
|
|
|
|
return number + '-й';
|
|
|
|
|
case 'D':
|
|
|
|
|
return number + '-го';
|
|
|
|
|
case 'w':
|
|
|
|
|
case 'W':
|
|
|
|
|
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.
|
|
|
|
|
}
|
|
|
|
|
});
|
2016-04-01 05:33:25 +08:00
|
|
|
|
|
|
|
|
|
return ru;
|
|
|
|
|
|
|
|
|
|
}));
|