bs.js (5675B)
1//! moment.js locale configuration 2//! locale : Bosnian [bs] 3//! author : Nedim Cholich : https://github.com/frontyard 4//! author : Rasid Redzic : https://github.com/rasidre 5//! based on (hr) translation by Bojan Marković 6 7;(function (global, factory) { 8 typeof exports === 'object' && typeof module !== 'undefined' 9 && typeof require === 'function' ? factory(require('../moment')) : 10 typeof define === 'function' && define.amd ? define(['../moment'], factory) : 11 factory(global.moment) 12}(this, (function (moment) { 'use strict'; 13 14 //! moment.js locale configuration 15 16 function processRelativeTime(number, withoutSuffix, key, isFuture) { 17 switch (key) { 18 case 'm': 19 return withoutSuffix 20 ? 'jedna minuta' 21 : isFuture 22 ? 'jednu minutu' 23 : 'jedne minute'; 24 } 25 } 26 27 function translate(number, withoutSuffix, key) { 28 var result = number + ' '; 29 switch (key) { 30 case 'ss': 31 if (number === 1) { 32 result += 'sekunda'; 33 } else if (number === 2 || number === 3 || number === 4) { 34 result += 'sekunde'; 35 } else { 36 result += 'sekundi'; 37 } 38 return result; 39 case 'mm': 40 if (number === 1) { 41 result += 'minuta'; 42 } else if (number === 2 || number === 3 || number === 4) { 43 result += 'minute'; 44 } else { 45 result += 'minuta'; 46 } 47 return result; 48 case 'h': 49 return withoutSuffix ? 'jedan sat' : 'jedan sat'; 50 case 'hh': 51 if (number === 1) { 52 result += 'sat'; 53 } else if (number === 2 || number === 3 || number === 4) { 54 result += 'sata'; 55 } else { 56 result += 'sati'; 57 } 58 return result; 59 case 'dd': 60 if (number === 1) { 61 result += 'dan'; 62 } else { 63 result += 'dana'; 64 } 65 return result; 66 case 'MM': 67 if (number === 1) { 68 result += 'mjesec'; 69 } else if (number === 2 || number === 3 || number === 4) { 70 result += 'mjeseca'; 71 } else { 72 result += 'mjeseci'; 73 } 74 return result; 75 case 'yy': 76 if (number === 1) { 77 result += 'godina'; 78 } else if (number === 2 || number === 3 || number === 4) { 79 result += 'godine'; 80 } else { 81 result += 'godina'; 82 } 83 return result; 84 } 85 } 86 87 var bs = moment.defineLocale('bs', { 88 months: 'januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar'.split( 89 '_' 90 ), 91 monthsShort: 92 'jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.'.split( 93 '_' 94 ), 95 monthsParseExact: true, 96 weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split( 97 '_' 98 ), 99 weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'), 100 weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'), 101 weekdaysParseExact: true, 102 longDateFormat: { 103 LT: 'H:mm', 104 LTS: 'H:mm:ss', 105 L: 'DD.MM.YYYY', 106 LL: 'D. MMMM YYYY', 107 LLL: 'D. MMMM YYYY H:mm', 108 LLLL: 'dddd, D. MMMM YYYY H:mm', 109 }, 110 calendar: { 111 sameDay: '[danas u] LT', 112 nextDay: '[sutra u] LT', 113 nextWeek: function () { 114 switch (this.day()) { 115 case 0: 116 return '[u] [nedjelju] [u] LT'; 117 case 3: 118 return '[u] [srijedu] [u] LT'; 119 case 6: 120 return '[u] [subotu] [u] LT'; 121 case 1: 122 case 2: 123 case 4: 124 case 5: 125 return '[u] dddd [u] LT'; 126 } 127 }, 128 lastDay: '[jučer u] LT', 129 lastWeek: function () { 130 switch (this.day()) { 131 case 0: 132 case 3: 133 return '[prošlu] dddd [u] LT'; 134 case 6: 135 return '[prošle] [subote] [u] LT'; 136 case 1: 137 case 2: 138 case 4: 139 case 5: 140 return '[prošli] dddd [u] LT'; 141 } 142 }, 143 sameElse: 'L', 144 }, 145 relativeTime: { 146 future: 'za %s', 147 past: 'prije %s', 148 s: 'par sekundi', 149 ss: translate, 150 m: processRelativeTime, 151 mm: translate, 152 h: translate, 153 hh: translate, 154 d: 'dan', 155 dd: translate, 156 M: 'mjesec', 157 MM: translate, 158 y: 'godinu', 159 yy: translate, 160 }, 161 dayOfMonthOrdinalParse: /\d{1,2}\./, 162 ordinal: '%d.', 163 week: { 164 dow: 1, // Monday is the first day of the week. 165 doy: 7, // The week that contains Jan 7th is the first week of the year. 166 }, 167 }); 168 169 return bs; 170 171})));