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