Debian Codegraph @

resources/lib/moment/locale/sr.js

raw symbols SCIP
1 //! moment.js locale configuration
2 //! locale : Serbian [sr]
3 //! author : Milan Janačković<[email protected]> : https://github.com/milan-j
4
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) :
9 factory(global.moment)
10 }(this, (function (moment) { 'use strict';
11
12 //! moment.js locale configuration
13
14 var translator = {
15 words: {
16 //Different grammatical cases
17 ss: ['sekunda', 'sekunde', 'sekundi'],
18 m: ['jedan minut', 'jedne minute'],
19 mm: ['minut', 'minute', 'minuta'],
20 h: ['jedan sat', 'jednog sata'],
21 hh: ['sat', 'sata', 'sati'],
22 dd: ['dan', 'dana', 'dana'],
23 MM: ['mesec', 'meseca', 'meseci'],
24 yy: ['godina', 'godine', 'godina'],
25 },
26 correctGrammaticalCase: function (number, wordKey) {
27 return number === 1
28 ? wordKey[0]
29 : number >= 2 && number <= 4
30 ? wordKey[1]
31 : wordKey[2];
32 },
33 translate: function (number, withoutSuffix, key) {
34 var wordKey = translator.words[key];
35 if (key.length === 1) {
36 return withoutSuffix ? wordKey[0] : wordKey[1];
37 } else {
38 return (
39 number +
40 ' ' +
41 translator.correctGrammaticalCase(number, wordKey)
42 );
43 }
44 },
45 };
46
47 var sr = moment.defineLocale('sr', {
48 months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split(
49 '_'
50 ),
51 monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split(
52 '_'
53 ),
54 monthsParseExact: true,
55 weekdays: 'nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota'.split(
56 '_'
57 ),
58 weekdaysShort: 'ned._pon._uto._sre._čet._pet._sub.'.split('_'),
59 weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
60 weekdaysParseExact: true,
61 longDateFormat: {
62 LT: 'H:mm',
63 LTS: 'H:mm:ss',
64 L: 'DD.MM.YYYY',
65 LL: 'D. MMMM YYYY',
66 LLL: 'D. MMMM YYYY H:mm',
67 LLLL: 'dddd, D. MMMM YYYY H:mm',
68 },
69 calendar: {
70 sameDay: '[danas u] LT',
71 nextDay: '[sutra u] LT',
72 nextWeek: function () {
73 switch (this.day()) {
74 case 0:
75 return '[u] [nedelju] [u] LT';
76 case 3:
77 return '[u] [sredu] [u] LT';
78 case 6:
79 return '[u] [subotu] [u] LT';
80 case 1:
81 case 2:
82 case 4:
83 case 5:
84 return '[u] dddd [u] LT';
85 }
86 },
87 lastDay: '[juče u] LT',
88 lastWeek: function () {
89 var lastWeekDays = [
90 '[prošle] [nedelje] [u] LT',
91 '[prošlog] [ponedeljka] [u] LT',
92 '[prošlog] [utorka] [u] LT',
93 '[prošle] [srede] [u] LT',
94 '[prošlog] [četvrtka] [u] LT',
95 '[prošlog] [petka] [u] LT',
96 '[prošle] [subote] [u] LT',
97 ];
98 return lastWeekDays[this.day()];
99 },
100 sameElse: 'L',
101 },
102 relativeTime: {
103 future: 'za %s',
104 past: 'pre %s',
105 s: 'nekoliko sekundi',
106 ss: translator.translate,
107 m: translator.translate,
108 mm: translator.translate,
109 h: translator.translate,
110 hh: translator.translate,
111 d: 'dan',
112 dd: translator.translate,
113 M: 'mesec',
114 MM: translator.translate,
115 y: 'godinu',
116 yy: translator.translate,
117 },
118 dayOfMonthOrdinalParse: /\d{1,2}\./,
119 ordinal: '%d.',
120 week: {
121 dow: 1, // Monday is the first day of the week.
122 doy: 7, // The week that contains Jan 7th is the first week of the year.
123 },
124 });
125
126 return sr;
127
128 })));