2016-02-06 04:42:48 +08:00
|
|
|
|
//! moment.js locale configuration
|
2017-04-20 12:24:20 +08:00
|
|
|
|
//! locale : Serbian Cyrillic [sr-cyrl]
|
2016-02-06 04:42:48 +08:00
|
|
|
|
//! author : Milan Janačković<milanjanackovic@gmail.com> : https://github.com/milan-j
|
|
|
|
|
|
|
|
|
|
;(function (global, factory) {
|
|
|
|
|
typeof exports === 'object' && typeof module !== 'undefined'
|
|
|
|
|
&& typeof require === 'function' ? factory(require('../moment')) :
|
2017-04-20 12:24:20 +08:00
|
|
|
|
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
|
2016-02-06 04:42:48 +08:00
|
|
|
|
factory(global.moment)
|
2017-04-20 12:24:20 +08:00
|
|
|
|
}(this, (function (moment) { 'use strict';
|
2016-02-06 04:42:48 +08:00
|
|
|
|
|
2014-08-21 02:41:50 +08:00
|
|
|
|
|
2017-04-20 12:24:20 +08:00
|
|
|
|
var translator = {
|
|
|
|
|
words: { //Different grammatical cases
|
|
|
|
|
m: ['један минут', 'једне минуте'],
|
|
|
|
|
mm: ['минут', 'минуте', 'минута'],
|
|
|
|
|
h: ['један сат', 'једног сата'],
|
|
|
|
|
hh: ['сат', 'сата', 'сати'],
|
|
|
|
|
dd: ['дан', 'дана', 'дана'],
|
|
|
|
|
MM: ['месец', 'месеца', 'месеци'],
|
|
|
|
|
yy: ['година', 'године', 'година']
|
|
|
|
|
},
|
|
|
|
|
correctGrammaticalCase: function (number, wordKey) {
|
|
|
|
|
return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]);
|
|
|
|
|
},
|
|
|
|
|
translate: function (number, withoutSuffix, key) {
|
|
|
|
|
var wordKey = translator.words[key];
|
|
|
|
|
if (key.length === 1) {
|
|
|
|
|
return withoutSuffix ? wordKey[0] : wordKey[1];
|
|
|
|
|
} else {
|
|
|
|
|
return number + ' ' + translator.correctGrammaticalCase(number, wordKey);
|
2014-08-21 02:41:50 +08:00
|
|
|
|
}
|
2017-04-20 12:24:20 +08:00
|
|
|
|
}
|
|
|
|
|
};
|
2014-08-21 02:41:50 +08:00
|
|
|
|
|
2017-04-20 12:24:20 +08:00
|
|
|
|
var srCyrl = moment.defineLocale('sr-cyrl', {
|
|
|
|
|
months: 'јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар'.split('_'),
|
|
|
|
|
monthsShort: 'јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.'.split('_'),
|
|
|
|
|
monthsParseExact: true,
|
|
|
|
|
weekdays: 'недеља_понедељак_уторак_среда_четвртак_петак_субота'.split('_'),
|
|
|
|
|
weekdaysShort: 'нед._пон._уто._сре._чет._пет._суб.'.split('_'),
|
|
|
|
|
weekdaysMin: 'не_по_ут_ср_че_пе_су'.split('_'),
|
|
|
|
|
weekdaysParseExact : true,
|
|
|
|
|
longDateFormat: {
|
|
|
|
|
LT: 'H:mm',
|
|
|
|
|
LTS : 'H:mm:ss',
|
|
|
|
|
L: 'DD.MM.YYYY',
|
|
|
|
|
LL: 'D. MMMM YYYY',
|
|
|
|
|
LLL: 'D. MMMM YYYY H:mm',
|
|
|
|
|
LLLL: 'dddd, D. MMMM YYYY H:mm'
|
|
|
|
|
},
|
|
|
|
|
calendar: {
|
|
|
|
|
sameDay: '[данас у] LT',
|
|
|
|
|
nextDay: '[сутра у] LT',
|
|
|
|
|
nextWeek: function () {
|
|
|
|
|
switch (this.day()) {
|
2014-08-21 02:41:50 +08:00
|
|
|
|
case 0:
|
|
|
|
|
return '[у] [недељу] [у] LT';
|
|
|
|
|
case 3:
|
|
|
|
|
return '[у] [среду] [у] LT';
|
|
|
|
|
case 6:
|
|
|
|
|
return '[у] [суботу] [у] LT';
|
|
|
|
|
case 1:
|
|
|
|
|
case 2:
|
|
|
|
|
case 4:
|
|
|
|
|
case 5:
|
|
|
|
|
return '[у] dddd [у] LT';
|
2017-04-20 12:24:20 +08:00
|
|
|
|
}
|
2014-08-21 02:41:50 +08:00
|
|
|
|
},
|
2017-04-20 12:24:20 +08:00
|
|
|
|
lastDay : '[јуче у] LT',
|
|
|
|
|
lastWeek : function () {
|
|
|
|
|
var lastWeekDays = [
|
|
|
|
|
'[прошле] [недеље] [у] LT',
|
|
|
|
|
'[прошлог] [понедељка] [у] LT',
|
|
|
|
|
'[прошлог] [уторка] [у] LT',
|
|
|
|
|
'[прошле] [среде] [у] LT',
|
|
|
|
|
'[прошлог] [четвртка] [у] LT',
|
|
|
|
|
'[прошлог] [петка] [у] LT',
|
|
|
|
|
'[прошле] [суботе] [у] LT'
|
|
|
|
|
];
|
|
|
|
|
return lastWeekDays[this.day()];
|
2014-08-21 02:41:50 +08:00
|
|
|
|
},
|
2017-04-20 12:24:20 +08:00
|
|
|
|
sameElse : 'L'
|
|
|
|
|
},
|
|
|
|
|
relativeTime : {
|
|
|
|
|
future : 'за %s',
|
|
|
|
|
past : 'пре %s',
|
|
|
|
|
s : 'неколико секунди',
|
|
|
|
|
m : translator.translate,
|
|
|
|
|
mm : translator.translate,
|
|
|
|
|
h : translator.translate,
|
|
|
|
|
hh : translator.translate,
|
|
|
|
|
d : 'дан',
|
|
|
|
|
dd : translator.translate,
|
|
|
|
|
M : 'месец',
|
|
|
|
|
MM : translator.translate,
|
|
|
|
|
y : 'годину',
|
|
|
|
|
yy : translator.translate
|
|
|
|
|
},
|
|
|
|
|
dayOfMonthOrdinalParse: /\d{1,2}\./,
|
|
|
|
|
ordinal : '%d.',
|
|
|
|
|
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-02-06 04:42:48 +08:00
|
|
|
|
|
2017-04-20 12:24:20 +08:00
|
|
|
|
return srCyrl;
|
2016-02-06 04:42:48 +08:00
|
|
|
|
|
2017-04-20 12:24:20 +08:00
|
|
|
|
})));
|