1 //! moment.js locale configuration
2 //! locale : Serbian-latin (sr)
3 //! author : Milan Janačković<milanjanackovic@gmail.com> : https://github.com/milan-j
5 ;(function (global, factory) {
6 typeof exports === 'object' && typeof module !== 'undefined'
7 && typeof require === 'function' ? factory(require('../moment')) :
8 typeof define === 'function' && define.amd ? define(['moment'], factory) :
10 }(this, function (moment) { 'use strict';
14 words: { //Different grammatical cases
15 m: ['jedan minut', 'jedne minute'],
16 mm: ['minut', 'minute', 'minuta'],
17 h: ['jedan sat', 'jednog sata'],
18 hh: ['sat', 'sata', 'sati'],
19 dd: ['dan', 'dana', 'dana'],
20 MM: ['mesec', 'meseca', 'meseci'],
21 yy: ['godina', 'godine', 'godina']
23 correctGrammaticalCase: function (number, wordKey) {
24 return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]);
26 translate: function (number, withoutSuffix, key) {
27 var wordKey = translator.words[key];
28 if (key.length === 1) {
29 return withoutSuffix ? wordKey[0] : wordKey[1];
31 return number + ' ' + translator.correctGrammaticalCase(number, wordKey);
36 var sr = moment.defineLocale('sr', {
37 months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split('_'),
38 monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split('_'),
39 monthsParseExact: true,
40 weekdays: 'nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota'.split('_'),
41 weekdaysShort: 'ned._pon._uto._sre._čet._pet._sub.'.split('_'),
42 weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
43 weekdaysParseExact : true,
49 LLL: 'D. MMMM YYYY H:mm',
50 LLLL: 'dddd, D. MMMM YYYY H:mm'
53 sameDay: '[danas u] LT',
54 nextDay: '[sutra u] LT',
55 nextWeek: function () {
58 return '[u] [nedelju] [u] LT';
60 return '[u] [sredu] [u] LT';
62 return '[u] [subotu] [u] LT';
67 return '[u] dddd [u] LT';
70 lastDay : '[juče u] LT',
71 lastWeek : function () {
73 '[prošle] [nedelje] [u] LT',
74 '[prošlog] [ponedeljka] [u] LT',
75 '[prošlog] [utorka] [u] LT',
76 '[prošle] [srede] [u] LT',
77 '[prošlog] [četvrtka] [u] LT',
78 '[prošlog] [petka] [u] LT',
79 '[prošle] [subote] [u] LT'
81 return lastWeekDays[this.day()];
88 s : 'nekoliko sekundi',
89 m : translator.translate,
90 mm : translator.translate,
91 h : translator.translate,
92 hh : translator.translate,
94 dd : translator.translate,
96 MM : translator.translate,
98 yy : translator.translate
100 ordinalParse: /\d{1,2}\./,
103 dow : 1, // Monday is the first day of the week.
104 doy : 7 // The week that contains Jan 1st is the first week of the year.