is.js (5334B)
1//! moment.js locale configuration 2//! locale : Icelandic [is] 3//! author : Hinrik Örn Sigurðsson : https://github.com/hinrik 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 plural(n) { 15 if (n % 100 === 11) { 16 return true; 17 } else if (n % 10 === 1) { 18 return false; 19 } 20 return true; 21 } 22 function translate(number, withoutSuffix, key, isFuture) { 23 var result = number + ' '; 24 switch (key) { 25 case 's': 26 return withoutSuffix || isFuture 27 ? 'nokkrar sekúndur' 28 : 'nokkrum sekúndum'; 29 case 'ss': 30 if (plural(number)) { 31 return ( 32 result + 33 (withoutSuffix || isFuture ? 'sekúndur' : 'sekúndum') 34 ); 35 } 36 return result + 'sekúnda'; 37 case 'm': 38 return withoutSuffix ? 'mínúta' : 'mínútu'; 39 case 'mm': 40 if (plural(number)) { 41 return ( 42 result + (withoutSuffix || isFuture ? 'mínútur' : 'mínútum') 43 ); 44 } else if (withoutSuffix) { 45 return result + 'mínúta'; 46 } 47 return result + 'mínútu'; 48 case 'hh': 49 if (plural(number)) { 50 return ( 51 result + 52 (withoutSuffix || isFuture 53 ? 'klukkustundir' 54 : 'klukkustundum') 55 ); 56 } 57 return result + 'klukkustund'; 58 case 'd': 59 if (withoutSuffix) { 60 return 'dagur'; 61 } 62 return isFuture ? 'dag' : 'degi'; 63 case 'dd': 64 if (plural(number)) { 65 if (withoutSuffix) { 66 return result + 'dagar'; 67 } 68 return result + (isFuture ? 'daga' : 'dögum'); 69 } else if (withoutSuffix) { 70 return result + 'dagur'; 71 } 72 return result + (isFuture ? 'dag' : 'degi'); 73 case 'M': 74 if (withoutSuffix) { 75 return 'mánuður'; 76 } 77 return isFuture ? 'mánuð' : 'mánuði'; 78 case 'MM': 79 if (plural(number)) { 80 if (withoutSuffix) { 81 return result + 'mánuðir'; 82 } 83 return result + (isFuture ? 'mánuði' : 'mánuðum'); 84 } else if (withoutSuffix) { 85 return result + 'mánuður'; 86 } 87 return result + (isFuture ? 'mánuð' : 'mánuði'); 88 case 'y': 89 return withoutSuffix || isFuture ? 'ár' : 'ári'; 90 case 'yy': 91 if (plural(number)) { 92 return result + (withoutSuffix || isFuture ? 'ár' : 'árum'); 93 } 94 return result + (withoutSuffix || isFuture ? 'ár' : 'ári'); 95 } 96 } 97 98 var is = moment.defineLocale('is', { 99 months: 'janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember'.split( 100 '_' 101 ), 102 monthsShort: 'jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des'.split('_'), 103 weekdays: 104 'sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur'.split( 105 '_' 106 ), 107 weekdaysShort: 'sun_mán_þri_mið_fim_fös_lau'.split('_'), 108 weekdaysMin: 'Su_Má_Þr_Mi_Fi_Fö_La'.split('_'), 109 longDateFormat: { 110 LT: 'H:mm', 111 LTS: 'H:mm:ss', 112 L: 'DD.MM.YYYY', 113 LL: 'D. MMMM YYYY', 114 LLL: 'D. MMMM YYYY [kl.] H:mm', 115 LLLL: 'dddd, D. MMMM YYYY [kl.] H:mm', 116 }, 117 calendar: { 118 sameDay: '[í dag kl.] LT', 119 nextDay: '[á morgun kl.] LT', 120 nextWeek: 'dddd [kl.] LT', 121 lastDay: '[í gær kl.] LT', 122 lastWeek: '[síðasta] dddd [kl.] LT', 123 sameElse: 'L', 124 }, 125 relativeTime: { 126 future: 'eftir %s', 127 past: 'fyrir %s síðan', 128 s: translate, 129 ss: translate, 130 m: translate, 131 mm: translate, 132 h: 'klukkustund', 133 hh: translate, 134 d: translate, 135 dd: translate, 136 M: translate, 137 MM: translate, 138 y: translate, 139 yy: translate, 140 }, 141 dayOfMonthOrdinalParse: /\d{1,2}\./, 142 ordinal: '%d.', 143 week: { 144 dow: 1, // Monday is the first day of the week. 145 doy: 4, // The week that contains Jan 4th is the first week of the year. 146 }, 147 }); 148 149 return is; 150 151})));