2016-02-05 15:42:48 -05:00
|
|
|
//! moment.js locale configuration
|
2020-11-10 20:34:26 -05:00
|
|
|
//! locale : Serbian [sr]
|
|
|
|
//! author : Milan Janačković<milanjanackovic@gmail.com> : https://github.com/milan-j
|
|
|
|
//! author : Stefan Crnjaković <stefan@hotmail.rs> : https://github.com/crnjakovic
|
2016-02-05 15:42:48 -05:00
|
|
|
|
|
|
|
;(function (global, factory) {
|
|
|
|
typeof exports === 'object' && typeof module !== 'undefined'
|
|
|
|
&& typeof require === 'function' ? factory(require('../moment')) :
|
2017-04-20 00:24:20 -04:00
|
|
|
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
|
2016-02-05 15:42:48 -05:00
|
|
|
factory(global.moment)
|
2017-04-20 00:24:20 -04:00
|
|
|
}(this, (function (moment) { 'use strict';
|
2016-02-05 15:42:48 -05:00
|
|
|
|
2020-11-10 20:34:26 -05:00
|
|
|
//! moment.js locale configuration
|
2014-08-20 14:41:50 -04:00
|
|
|
|
2018-04-26 03:15:53 -04:00
|
|
|
var translator = {
|
2020-11-10 20:34:26 -05:00
|
|
|
words: {
|
|
|
|
//Different grammatical cases
|
2018-04-26 03:15:53 -04:00
|
|
|
ss: ['sekunda', 'sekunde', 'sekundi'],
|
2022-04-11 13:27:24 -04:00
|
|
|
m: ['jedan minut', 'jednog minuta'],
|
|
|
|
mm: ['minut', 'minuta', 'minuta'],
|
2018-04-26 03:15:53 -04:00
|
|
|
h: ['jedan sat', 'jednog sata'],
|
|
|
|
hh: ['sat', 'sata', 'sati'],
|
2022-04-11 13:27:24 -04:00
|
|
|
d: ['jedan dan', 'jednog dana'],
|
2018-04-26 03:15:53 -04:00
|
|
|
dd: ['dan', 'dana', 'dana'],
|
2022-04-11 13:27:24 -04:00
|
|
|
M: ['jedan mesec', 'jednog meseca'],
|
2018-04-26 03:15:53 -04:00
|
|
|
MM: ['mesec', 'meseca', 'meseci'],
|
2022-04-11 13:27:24 -04:00
|
|
|
y: ['jednu godinu', 'jedne godine'],
|
|
|
|
yy: ['godinu', 'godine', 'godina'],
|
2018-04-26 03:15:53 -04:00
|
|
|
},
|
|
|
|
correctGrammaticalCase: function (number, wordKey) {
|
2022-04-11 13:27:24 -04: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 03:15:53 -04:00
|
|
|
},
|
2022-04-11 13:27:24 -04:00
|
|
|
translate: function (number, withoutSuffix, key, isFuture) {
|
2018-04-26 03:15:53 -04:00
|
|
|
var wordKey = translator.words[key];
|
2022-04-11 13:27:24 -04:00
|
|
|
|
2018-04-26 03:15:53 -04:00
|
|
|
if (key.length === 1) {
|
2022-04-11 13:27:24 -04:00
|
|
|
// Nominativ
|
|
|
|
if (key === 'y' && withoutSuffix) return 'jedna godina';
|
|
|
|
return isFuture || withoutSuffix ? wordKey[0] : wordKey[1];
|
|
|
|
}
|
|
|
|
|
|
|
|
const word = translator.correctGrammaticalCase(number, wordKey);
|
|
|
|
// Nominativ
|
|
|
|
if (key === 'yy' && withoutSuffix && word === 'godinu') {
|
|
|
|
return number + ' godina';
|
2018-04-26 03:15:53 -04:00
|
|
|
}
|
2022-04-11 13:27:24 -04:00
|
|
|
|
|
|
|
return number + ' ' + word;
|
2020-11-10 20:34:26 -05:00
|
|
|
},
|
2018-04-26 03:15:53 -04:00
|
|
|
};
|
2014-08-20 14:41:50 -04:00
|
|
|
|
2018-04-26 03:15:53 -04:00
|
|
|
var sr = moment.defineLocale('sr', {
|
2020-11-10 20:34:26 -05:00
|
|
|
months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split(
|
|
|
|
'_'
|
|
|
|
),
|
2022-04-11 13:27:24 -04:00
|
|
|
monthsShort:
|
|
|
|
'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split('_'),
|
2018-04-26 03:15:53 -04:00
|
|
|
monthsParseExact: true,
|
2020-11-10 20:34:26 -05:00
|
|
|
weekdays: 'nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota'.split(
|
|
|
|
'_'
|
|
|
|
),
|
2018-04-26 03:15:53 -04:00
|
|
|
weekdaysShort: 'ned._pon._uto._sre._čet._pet._sub.'.split('_'),
|
|
|
|
weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
|
2020-11-10 20:34:26 -05:00
|
|
|
weekdaysParseExact: true,
|
2018-04-26 03:15:53 -04:00
|
|
|
longDateFormat: {
|
|
|
|
LT: 'H:mm',
|
2020-11-10 20:34:26 -05: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 03:15:53 -04: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-11-10 20:34:26 -05:00
|
|
|
lastDay: '[juče u] LT',
|
|
|
|
lastWeek: function () {
|
2018-04-26 03:15:53 -04: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-11-10 20:34:26 -05:00
|
|
|
'[prošle] [subote] [u] LT',
|
2018-04-26 03:15:53 -04:00
|
|
|
];
|
|
|
|
return lastWeekDays[this.day()];
|
|
|
|
},
|
2020-11-10 20:34:26 -05:00
|
|
|
sameElse: 'L',
|
2014-08-20 14:41:50 -04:00
|
|
|
},
|
2020-11-10 20:34:26 -05: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,
|
2022-04-11 13:27:24 -04:00
|
|
|
d: translator.translate,
|
2020-11-10 20:34:26 -05:00
|
|
|
dd: translator.translate,
|
2022-04-11 13:27:24 -04:00
|
|
|
M: translator.translate,
|
2020-11-10 20:34:26 -05:00
|
|
|
MM: translator.translate,
|
2022-04-11 13:27:24 -04:00
|
|
|
y: translator.translate,
|
2020-11-10 20:34:26 -05:00
|
|
|
yy: translator.translate,
|
2014-08-20 14:41:50 -04:00
|
|
|
},
|
2018-04-26 03:15:53 -04:00
|
|
|
dayOfMonthOrdinalParse: /\d{1,2}\./,
|
2020-11-10 20:34:26 -05: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.
|
|
|
|
},
|
2018-04-26 03:15:53 -04:00
|
|
|
});
|
2016-02-05 15:42:48 -05:00
|
|
|
|
2018-04-26 03:15:53 -04:00
|
|
|
return sr;
|
2016-02-05 15:42:48 -05:00
|
|
|
|
2017-04-20 00:24:20 -04:00
|
|
|
})));
|