ku-kmr.js (4890B)
1//! moment.js locale configuration 2//! locale : Northern Kurdish [ku-kmr] 3//! authors : Mazlum Özdogan : https://github.com/mergehez 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(num, withoutSuffix, key, isFuture) { 15 var format = { 16 s: ['çend sanîye', 'çend sanîyeyan'], 17 ss: [num + ' sanîye', num + ' sanîyeyan'], 18 m: ['deqîqeyek', 'deqîqeyekê'], 19 mm: [num + ' deqîqe', num + ' deqîqeyan'], 20 h: ['saetek', 'saetekê'], 21 hh: [num + ' saet', num + ' saetan'], 22 d: ['rojek', 'rojekê'], 23 dd: [num + ' roj', num + ' rojan'], 24 w: ['hefteyek', 'hefteyekê'], 25 ww: [num + ' hefte', num + ' hefteyan'], 26 M: ['mehek', 'mehekê'], 27 MM: [num + ' meh', num + ' mehan'], 28 y: ['salek', 'salekê'], 29 yy: [num + ' sal', num + ' salan'], 30 }; 31 return withoutSuffix ? format[key][0] : format[key][1]; 32 } 33 // function obliqueNumSuffix(num) { 34 // if(num.includes(':')) 35 // num = parseInt(num.split(':')[0]); 36 // else 37 // num = parseInt(num); 38 // return num == 0 || num % 10 == 1 ? 'ê' 39 // : (num > 10 && num % 10 == 0 ? 'î' : 'an'); 40 // } 41 function ezafeNumSuffix(num) { 42 num = '' + num; 43 var l = num.substring(num.length - 1), 44 ll = num.length > 1 ? num.substring(num.length - 2) : ''; 45 if ( 46 !(ll == 12 || ll == 13) && 47 (l == '2' || l == '3' || ll == '50' || l == '70' || l == '80') 48 ) 49 return 'yê'; 50 return 'ê'; 51 } 52 53 var kuKmr = moment.defineLocale('ku-kmr', { 54 // According to the spelling rules defined by the work group of Weqfa Mezopotamyayê (Mesopotamia Foundation) 55 // this should be: 'Kanûna Paşîn_Sibat_Adar_Nîsan_Gulan_Hezîran_Tîrmeh_Tebax_Îlon_Çirîya Pêşîn_Çirîya Paşîn_Kanûna Pêşîn' 56 // But the names below are more well known and handy 57 months: 'Rêbendan_Sibat_Adar_Nîsan_Gulan_Hezîran_Tîrmeh_Tebax_Îlon_Cotmeh_Mijdar_Berfanbar'.split( 58 '_' 59 ), 60 monthsShort: 'Rêb_Sib_Ada_Nîs_Gul_Hez_Tîr_Teb_Îlo_Cot_Mij_Ber'.split('_'), 61 monthsParseExact: true, 62 weekdays: 'Yekşem_Duşem_Sêşem_Çarşem_Pêncşem_În_Şemî'.split('_'), 63 weekdaysShort: 'Yek_Du_Sê_Çar_Pên_În_Şem'.split('_'), 64 weekdaysMin: 'Ye_Du_Sê_Ça_Pê_În_Şe'.split('_'), 65 meridiem: function (hours, minutes, isLower) { 66 if (hours < 12) { 67 return isLower ? 'bn' : 'BN'; 68 } else { 69 return isLower ? 'pn' : 'PN'; 70 } 71 }, 72 meridiemParse: /bn|BN|pn|PN/, 73 longDateFormat: { 74 LT: 'HH:mm', 75 LTS: 'HH:mm:ss', 76 L: 'DD.MM.YYYY', 77 LL: 'Do MMMM[a] YYYY[an]', 78 LLL: 'Do MMMM[a] YYYY[an] HH:mm', 79 LLLL: 'dddd, Do MMMM[a] YYYY[an] HH:mm', 80 ll: 'Do MMM[.] YYYY[an]', 81 lll: 'Do MMM[.] YYYY[an] HH:mm', 82 llll: 'ddd[.], Do MMM[.] YYYY[an] HH:mm', 83 }, 84 calendar: { 85 sameDay: '[Îro di saet] LT [de]', 86 nextDay: '[Sibê di saet] LT [de]', 87 nextWeek: 'dddd [di saet] LT [de]', 88 lastDay: '[Duh di saet] LT [de]', 89 lastWeek: 'dddd[a borî di saet] LT [de]', 90 sameElse: 'L', 91 }, 92 relativeTime: { 93 future: 'di %s de', 94 past: 'berî %s', 95 s: processRelativeTime, 96 ss: processRelativeTime, 97 m: processRelativeTime, 98 mm: processRelativeTime, 99 h: processRelativeTime, 100 hh: processRelativeTime, 101 d: processRelativeTime, 102 dd: processRelativeTime, 103 w: processRelativeTime, 104 ww: processRelativeTime, 105 M: processRelativeTime, 106 MM: processRelativeTime, 107 y: processRelativeTime, 108 yy: processRelativeTime, 109 }, 110 dayOfMonthOrdinalParse: /\d{1,2}(?:yê|ê|\.)/, 111 ordinal: function (num, period) { 112 var p = period.toLowerCase(); 113 if (p.includes('w') || p.includes('m')) return num + '.'; 114 115 return num + ezafeNumSuffix(num); 116 }, 117 week: { 118 dow: 1, // Monday is the first day of the week. 119 doy: 4, // The week that contains Jan 4th is the first week of the year. 120 }, 121 }); 122 123 return kuKmr; 124 125})));