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