@@ 5-174 (lines=170) @@ | ||
2 | //! locale : Slovenian [sl] |
|
3 | //! author : Robert Sedovšek : https://github.com/sedovsek |
|
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 | ||
13 | function processRelativeTime(number, withoutSuffix, key, isFuture) { |
|
14 | var result = number + ' '; |
|
15 | switch (key) { |
|
16 | case 's': |
|
17 | return withoutSuffix || isFuture ? 'nekaj sekund' : 'nekaj sekundami'; |
|
18 | case 'ss': |
|
19 | if (number === 1) { |
|
20 | result += withoutSuffix ? 'sekundo' : 'sekundi'; |
|
21 | } else if (number === 2) { |
|
22 | result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah'; |
|
23 | } else if (number < 5) { |
|
24 | result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah'; |
|
25 | } else { |
|
26 | result += withoutSuffix || isFuture ? 'sekund' : 'sekund'; |
|
27 | } |
|
28 | return result; |
|
29 | case 'm': |
|
30 | return withoutSuffix ? 'ena minuta' : 'eno minuto'; |
|
31 | case 'mm': |
|
32 | if (number === 1) { |
|
33 | result += withoutSuffix ? 'minuta' : 'minuto'; |
|
34 | } else if (number === 2) { |
|
35 | result += withoutSuffix || isFuture ? 'minuti' : 'minutama'; |
|
36 | } else if (number < 5) { |
|
37 | result += withoutSuffix || isFuture ? 'minute' : 'minutami'; |
|
38 | } else { |
|
39 | result += withoutSuffix || isFuture ? 'minut' : 'minutami'; |
|
40 | } |
|
41 | return result; |
|
42 | case 'h': |
|
43 | return withoutSuffix ? 'ena ura' : 'eno uro'; |
|
44 | case 'hh': |
|
45 | if (number === 1) { |
|
46 | result += withoutSuffix ? 'ura' : 'uro'; |
|
47 | } else if (number === 2) { |
|
48 | result += withoutSuffix || isFuture ? 'uri' : 'urama'; |
|
49 | } else if (number < 5) { |
|
50 | result += withoutSuffix || isFuture ? 'ure' : 'urami'; |
|
51 | } else { |
|
52 | result += withoutSuffix || isFuture ? 'ur' : 'urami'; |
|
53 | } |
|
54 | return result; |
|
55 | case 'd': |
|
56 | return withoutSuffix || isFuture ? 'en dan' : 'enim dnem'; |
|
57 | case 'dd': |
|
58 | if (number === 1) { |
|
59 | result += withoutSuffix || isFuture ? 'dan' : 'dnem'; |
|
60 | } else if (number === 2) { |
|
61 | result += withoutSuffix || isFuture ? 'dni' : 'dnevoma'; |
|
62 | } else { |
|
63 | result += withoutSuffix || isFuture ? 'dni' : 'dnevi'; |
|
64 | } |
|
65 | return result; |
|
66 | case 'M': |
|
67 | return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem'; |
|
68 | case 'MM': |
|
69 | if (number === 1) { |
|
70 | result += withoutSuffix || isFuture ? 'mesec' : 'mesecem'; |
|
71 | } else if (number === 2) { |
|
72 | result += withoutSuffix || isFuture ? 'meseca' : 'mesecema'; |
|
73 | } else if (number < 5) { |
|
74 | result += withoutSuffix || isFuture ? 'mesece' : 'meseci'; |
|
75 | } else { |
|
76 | result += withoutSuffix || isFuture ? 'mesecev' : 'meseci'; |
|
77 | } |
|
78 | return result; |
|
79 | case 'y': |
|
80 | return withoutSuffix || isFuture ? 'eno leto' : 'enim letom'; |
|
81 | case 'yy': |
|
82 | if (number === 1) { |
|
83 | result += withoutSuffix || isFuture ? 'leto' : 'letom'; |
|
84 | } else if (number === 2) { |
|
85 | result += withoutSuffix || isFuture ? 'leti' : 'letoma'; |
|
86 | } else if (number < 5) { |
|
87 | result += withoutSuffix || isFuture ? 'leta' : 'leti'; |
|
88 | } else { |
|
89 | result += withoutSuffix || isFuture ? 'let' : 'leti'; |
|
90 | } |
|
91 | return result; |
|
92 | } |
|
93 | } |
|
94 | ||
95 | var sl = moment.defineLocale('sl', { |
|
96 | months : 'januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december'.split('_'), |
|
97 | monthsShort : 'jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.'.split('_'), |
|
98 | monthsParseExact: true, |
|
99 | weekdays : 'nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota'.split('_'), |
|
100 | weekdaysShort : 'ned._pon._tor._sre._čet._pet._sob.'.split('_'), |
|
101 | weekdaysMin : 'ne_po_to_sr_če_pe_so'.split('_'), |
|
102 | weekdaysParseExact : true, |
|
103 | longDateFormat : { |
|
104 | LT : 'H:mm', |
|
105 | LTS : 'H:mm:ss', |
|
106 | L : 'DD.MM.YYYY', |
|
107 | LL : 'D. MMMM YYYY', |
|
108 | LLL : 'D. MMMM YYYY H:mm', |
|
109 | LLLL : 'dddd, D. MMMM YYYY H:mm' |
|
110 | }, |
|
111 | calendar : { |
|
112 | sameDay : '[danes ob] LT', |
|
113 | nextDay : '[jutri ob] LT', |
|
114 | ||
115 | nextWeek : function () { |
|
116 | switch (this.day()) { |
|
117 | case 0: |
|
118 | return '[v] [nedeljo] [ob] LT'; |
|
119 | case 3: |
|
120 | return '[v] [sredo] [ob] LT'; |
|
121 | case 6: |
|
122 | return '[v] [soboto] [ob] LT'; |
|
123 | case 1: |
|
124 | case 2: |
|
125 | case 4: |
|
126 | case 5: |
|
127 | return '[v] dddd [ob] LT'; |
|
128 | } |
|
129 | }, |
|
130 | lastDay : '[včeraj ob] LT', |
|
131 | lastWeek : function () { |
|
132 | switch (this.day()) { |
|
133 | case 0: |
|
134 | return '[prejšnjo] [nedeljo] [ob] LT'; |
|
135 | case 3: |
|
136 | return '[prejšnjo] [sredo] [ob] LT'; |
|
137 | case 6: |
|
138 | return '[prejšnjo] [soboto] [ob] LT'; |
|
139 | case 1: |
|
140 | case 2: |
|
141 | case 4: |
|
142 | case 5: |
|
143 | return '[prejšnji] dddd [ob] LT'; |
|
144 | } |
|
145 | }, |
|
146 | sameElse : 'L' |
|
147 | }, |
|
148 | relativeTime : { |
|
149 | future : 'čez %s', |
|
150 | past : 'pred %s', |
|
151 | s : processRelativeTime, |
|
152 | ss : processRelativeTime, |
|
153 | m : processRelativeTime, |
|
154 | mm : processRelativeTime, |
|
155 | h : processRelativeTime, |
|
156 | hh : processRelativeTime, |
|
157 | d : processRelativeTime, |
|
158 | dd : processRelativeTime, |
|
159 | M : processRelativeTime, |
|
160 | MM : processRelativeTime, |
|
161 | y : processRelativeTime, |
|
162 | yy : processRelativeTime |
|
163 | }, |
|
164 | dayOfMonthOrdinalParse: /\d{1,2}\./, |
|
165 | ordinal : '%d.', |
|
166 | week : { |
|
167 | dow : 1, // Monday is the first day of the week. |
|
168 | doy : 7 // The week that contains Jan 1st is the first week of the year. |
|
169 | } |
|
170 | }); |
|
171 | ||
172 | return sl; |
|
173 | ||
174 | }))); |
|
175 |
@@ 5-164 (lines=160) @@ | ||
2 | //! locale : Slovenian [sl] |
|
3 | //! author : Robert Sedovšek : https://github.com/sedovsek |
|
4 | ||
5 | import moment from '../moment'; |
|
6 | ||
7 | function processRelativeTime(number, withoutSuffix, key, isFuture) { |
|
8 | var result = number + ' '; |
|
9 | switch (key) { |
|
10 | case 's': |
|
11 | return withoutSuffix || isFuture ? 'nekaj sekund' : 'nekaj sekundami'; |
|
12 | case 'ss': |
|
13 | if (number === 1) { |
|
14 | result += withoutSuffix ? 'sekundo' : 'sekundi'; |
|
15 | } else if (number === 2) { |
|
16 | result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah'; |
|
17 | } else if (number < 5) { |
|
18 | result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah'; |
|
19 | } else { |
|
20 | result += withoutSuffix || isFuture ? 'sekund' : 'sekund'; |
|
21 | } |
|
22 | return result; |
|
23 | case 'm': |
|
24 | return withoutSuffix ? 'ena minuta' : 'eno minuto'; |
|
25 | case 'mm': |
|
26 | if (number === 1) { |
|
27 | result += withoutSuffix ? 'minuta' : 'minuto'; |
|
28 | } else if (number === 2) { |
|
29 | result += withoutSuffix || isFuture ? 'minuti' : 'minutama'; |
|
30 | } else if (number < 5) { |
|
31 | result += withoutSuffix || isFuture ? 'minute' : 'minutami'; |
|
32 | } else { |
|
33 | result += withoutSuffix || isFuture ? 'minut' : 'minutami'; |
|
34 | } |
|
35 | return result; |
|
36 | case 'h': |
|
37 | return withoutSuffix ? 'ena ura' : 'eno uro'; |
|
38 | case 'hh': |
|
39 | if (number === 1) { |
|
40 | result += withoutSuffix ? 'ura' : 'uro'; |
|
41 | } else if (number === 2) { |
|
42 | result += withoutSuffix || isFuture ? 'uri' : 'urama'; |
|
43 | } else if (number < 5) { |
|
44 | result += withoutSuffix || isFuture ? 'ure' : 'urami'; |
|
45 | } else { |
|
46 | result += withoutSuffix || isFuture ? 'ur' : 'urami'; |
|
47 | } |
|
48 | return result; |
|
49 | case 'd': |
|
50 | return withoutSuffix || isFuture ? 'en dan' : 'enim dnem'; |
|
51 | case 'dd': |
|
52 | if (number === 1) { |
|
53 | result += withoutSuffix || isFuture ? 'dan' : 'dnem'; |
|
54 | } else if (number === 2) { |
|
55 | result += withoutSuffix || isFuture ? 'dni' : 'dnevoma'; |
|
56 | } else { |
|
57 | result += withoutSuffix || isFuture ? 'dni' : 'dnevi'; |
|
58 | } |
|
59 | return result; |
|
60 | case 'M': |
|
61 | return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem'; |
|
62 | case 'MM': |
|
63 | if (number === 1) { |
|
64 | result += withoutSuffix || isFuture ? 'mesec' : 'mesecem'; |
|
65 | } else if (number === 2) { |
|
66 | result += withoutSuffix || isFuture ? 'meseca' : 'mesecema'; |
|
67 | } else if (number < 5) { |
|
68 | result += withoutSuffix || isFuture ? 'mesece' : 'meseci'; |
|
69 | } else { |
|
70 | result += withoutSuffix || isFuture ? 'mesecev' : 'meseci'; |
|
71 | } |
|
72 | return result; |
|
73 | case 'y': |
|
74 | return withoutSuffix || isFuture ? 'eno leto' : 'enim letom'; |
|
75 | case 'yy': |
|
76 | if (number === 1) { |
|
77 | result += withoutSuffix || isFuture ? 'leto' : 'letom'; |
|
78 | } else if (number === 2) { |
|
79 | result += withoutSuffix || isFuture ? 'leti' : 'letoma'; |
|
80 | } else if (number < 5) { |
|
81 | result += withoutSuffix || isFuture ? 'leta' : 'leti'; |
|
82 | } else { |
|
83 | result += withoutSuffix || isFuture ? 'let' : 'leti'; |
|
84 | } |
|
85 | return result; |
|
86 | } |
|
87 | } |
|
88 | ||
89 | export default moment.defineLocale('sl', { |
|
90 | months : 'januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december'.split('_'), |
|
91 | monthsShort : 'jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.'.split('_'), |
|
92 | monthsParseExact: true, |
|
93 | weekdays : 'nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota'.split('_'), |
|
94 | weekdaysShort : 'ned._pon._tor._sre._čet._pet._sob.'.split('_'), |
|
95 | weekdaysMin : 'ne_po_to_sr_če_pe_so'.split('_'), |
|
96 | weekdaysParseExact : true, |
|
97 | longDateFormat : { |
|
98 | LT : 'H:mm', |
|
99 | LTS : 'H:mm:ss', |
|
100 | L : 'DD.MM.YYYY', |
|
101 | LL : 'D. MMMM YYYY', |
|
102 | LLL : 'D. MMMM YYYY H:mm', |
|
103 | LLLL : 'dddd, D. MMMM YYYY H:mm' |
|
104 | }, |
|
105 | calendar : { |
|
106 | sameDay : '[danes ob] LT', |
|
107 | nextDay : '[jutri ob] LT', |
|
108 | ||
109 | nextWeek : function () { |
|
110 | switch (this.day()) { |
|
111 | case 0: |
|
112 | return '[v] [nedeljo] [ob] LT'; |
|
113 | case 3: |
|
114 | return '[v] [sredo] [ob] LT'; |
|
115 | case 6: |
|
116 | return '[v] [soboto] [ob] LT'; |
|
117 | case 1: |
|
118 | case 2: |
|
119 | case 4: |
|
120 | case 5: |
|
121 | return '[v] dddd [ob] LT'; |
|
122 | } |
|
123 | }, |
|
124 | lastDay : '[včeraj ob] LT', |
|
125 | lastWeek : function () { |
|
126 | switch (this.day()) { |
|
127 | case 0: |
|
128 | return '[prejšnjo] [nedeljo] [ob] LT'; |
|
129 | case 3: |
|
130 | return '[prejšnjo] [sredo] [ob] LT'; |
|
131 | case 6: |
|
132 | return '[prejšnjo] [soboto] [ob] LT'; |
|
133 | case 1: |
|
134 | case 2: |
|
135 | case 4: |
|
136 | case 5: |
|
137 | return '[prejšnji] dddd [ob] LT'; |
|
138 | } |
|
139 | }, |
|
140 | sameElse : 'L' |
|
141 | }, |
|
142 | relativeTime : { |
|
143 | future : 'čez %s', |
|
144 | past : 'pred %s', |
|
145 | s : processRelativeTime, |
|
146 | ss : processRelativeTime, |
|
147 | m : processRelativeTime, |
|
148 | mm : processRelativeTime, |
|
149 | h : processRelativeTime, |
|
150 | hh : processRelativeTime, |
|
151 | d : processRelativeTime, |
|
152 | dd : processRelativeTime, |
|
153 | M : processRelativeTime, |
|
154 | MM : processRelativeTime, |
|
155 | y : processRelativeTime, |
|
156 | yy : processRelativeTime |
|
157 | }, |
|
158 | dayOfMonthOrdinalParse: /\d{1,2}\./, |
|
159 | ordinal : '%d.', |
|
160 | week : { |
|
161 | dow : 1, // Monday is the first day of the week. |
|
162 | doy : 7 // The week that contains Jan 1st is the first week of the year. |
|
163 | } |
|
164 | }); |
|
165 |