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