2019-06-10 15:38:54 +00:00
|
|
|
//! moment.js locale configuration
|
2020-07-23 21:12:30 +00:00
|
|
|
//! locale : Serbian [sr]
|
|
|
|
//! author : Milan Janačković<milanjanackovic@gmail.com> : https://github.com/milan-j
|
2019-06-10 15:38:54 +00:00
|
|
|
|
|
|
|
;(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';
|
|
|
|
|
2020-07-23 21:12:30 +00:00
|
|
|
//! moment.js locale configuration
|
2019-06-10 15:38:54 +00:00
|
|
|
|
|
|
|
var translator = {
|
2020-07-23 21:12:30 +00:00
|
|
|
words: {
|
|
|
|
//Different grammatical cases
|
2019-06-10 15:38:54 +00:00
|
|
|
ss: ['sekunda', 'sekunde', 'sekundi'],
|
|
|
|
m: ['jedan minut', 'jedne minute'],
|
|
|
|
mm: ['minut', 'minute', 'minuta'],
|
|
|
|
h: ['jedan sat', 'jednog sata'],
|
|
|
|
hh: ['sat', 'sata', 'sati'],
|
|
|
|
dd: ['dan', 'dana', 'dana'],
|
|
|
|
MM: ['mesec', 'meseca', 'meseci'],
|
2020-07-23 21:12:30 +00:00
|
|
|
yy: ['godina', 'godine', 'godina'],
|
2019-06-10 15:38:54 +00:00
|
|
|
},
|
|
|
|
correctGrammaticalCase: function (number, wordKey) {
|
2020-07-23 21:12:30 +00:00
|
|
|
return number === 1
|
|
|
|
? wordKey[0]
|
|
|
|
: number >= 2 && number <= 4
|
|
|
|
? wordKey[1]
|
|
|
|
: wordKey[2];
|
2019-06-10 15:38:54 +00:00
|
|
|
},
|
|
|
|
translate: function (number, withoutSuffix, key) {
|
|
|
|
var wordKey = translator.words[key];
|
|
|
|
if (key.length === 1) {
|
|
|
|
return withoutSuffix ? wordKey[0] : wordKey[1];
|
|
|
|
} else {
|
2020-07-23 21:12:30 +00:00
|
|
|
return (
|
|
|
|
number +
|
|
|
|
' ' +
|
|
|
|
translator.correctGrammaticalCase(number, wordKey)
|
|
|
|
);
|
2019-06-10 15:38:54 +00:00
|
|
|
}
|
2020-07-23 21:12:30 +00:00
|
|
|
},
|
2019-06-10 15:38:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
var sr = moment.defineLocale('sr', {
|
2020-07-23 21:12:30 +00:00
|
|
|
months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split(
|
|
|
|
'_'
|
|
|
|
),
|
|
|
|
monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split(
|
|
|
|
'_'
|
|
|
|
),
|
2019-06-10 15:38:54 +00:00
|
|
|
monthsParseExact: true,
|
2020-07-23 21:12:30 +00:00
|
|
|
weekdays: 'nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota'.split(
|
|
|
|
'_'
|
|
|
|
),
|
2019-06-10 15:38:54 +00:00
|
|
|
weekdaysShort: 'ned._pon._uto._sre._čet._pet._sub.'.split('_'),
|
|
|
|
weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
|
2020-07-23 21:12:30 +00:00
|
|
|
weekdaysParseExact: true,
|
2019-06-10 15:38:54 +00:00
|
|
|
longDateFormat: {
|
|
|
|
LT: 'H:mm',
|
2020-07-23 21:12:30 +00:00
|
|
|
LTS: 'H:mm:ss',
|
2019-06-10 15:38:54 +00:00
|
|
|
L: 'DD.MM.YYYY',
|
|
|
|
LL: 'D. MMMM YYYY',
|
|
|
|
LLL: 'D. MMMM YYYY H:mm',
|
2020-07-23 21:12:30 +00:00
|
|
|
LLLL: 'dddd, D. MMMM YYYY H:mm',
|
2019-06-10 15:38:54 +00:00
|
|
|
},
|
|
|
|
calendar: {
|
|
|
|
sameDay: '[danas u] LT',
|
|
|
|
nextDay: '[sutra u] LT',
|
|
|
|
nextWeek: function () {
|
|
|
|
switch (this.day()) {
|
|
|
|
case 0:
|
|
|
|
return '[u] [nedelju] [u] LT';
|
|
|
|
case 3:
|
|
|
|
return '[u] [sredu] [u] LT';
|
|
|
|
case 6:
|
|
|
|
return '[u] [subotu] [u] LT';
|
|
|
|
case 1:
|
|
|
|
case 2:
|
|
|
|
case 4:
|
|
|
|
case 5:
|
|
|
|
return '[u] dddd [u] LT';
|
|
|
|
}
|
|
|
|
},
|
2020-07-23 21:12:30 +00:00
|
|
|
lastDay: '[juče u] LT',
|
|
|
|
lastWeek: function () {
|
2019-06-10 15:38:54 +00:00
|
|
|
var lastWeekDays = [
|
|
|
|
'[prošle] [nedelje] [u] LT',
|
|
|
|
'[prošlog] [ponedeljka] [u] LT',
|
|
|
|
'[prošlog] [utorka] [u] LT',
|
|
|
|
'[prošle] [srede] [u] LT',
|
|
|
|
'[prošlog] [četvrtka] [u] LT',
|
|
|
|
'[prošlog] [petka] [u] LT',
|
2020-07-23 21:12:30 +00:00
|
|
|
'[prošle] [subote] [u] LT',
|
2019-06-10 15:38:54 +00:00
|
|
|
];
|
|
|
|
return lastWeekDays[this.day()];
|
|
|
|
},
|
2020-07-23 21:12:30 +00:00
|
|
|
sameElse: 'L',
|
2019-06-10 15:38:54 +00:00
|
|
|
},
|
2020-07-23 21:12:30 +00:00
|
|
|
relativeTime: {
|
|
|
|
future: 'za %s',
|
|
|
|
past: 'pre %s',
|
|
|
|
s: 'nekoliko sekundi',
|
|
|
|
ss: translator.translate,
|
|
|
|
m: translator.translate,
|
|
|
|
mm: translator.translate,
|
|
|
|
h: translator.translate,
|
|
|
|
hh: translator.translate,
|
|
|
|
d: 'dan',
|
|
|
|
dd: translator.translate,
|
|
|
|
M: 'mesec',
|
|
|
|
MM: translator.translate,
|
|
|
|
y: 'godinu',
|
|
|
|
yy: translator.translate,
|
2019-06-10 15:38:54 +00:00
|
|
|
},
|
|
|
|
dayOfMonthOrdinalParse: /\d{1,2}\./,
|
2020-07-23 21:12:30 +00:00
|
|
|
ordinal: '%d.',
|
|
|
|
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.
|
|
|
|
},
|
2019-06-10 15:38:54 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
return sr;
|
|
|
|
|
|
|
|
})));
|