summaryrefslogtreecommitdiff
path: root/node_modules/moment/src/locale/ku-kmr.js
blob: 87ad603b81c8c85ab678de5426398619ee8a92cd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
//! moment.js locale configuration
//! locale : Northern Kurdish [ku-kmr]
//! authors : Mazlum Özdogan : https://github.com/mergehez

// All rules except for month names are according to
// the spelling rules which are defined in the book 'Rêbera Rastnivîsînê' from Komxebata Kurmancîyê.
// Komxebata Kurmancîyê is a work group that studied different uses in Kurdish language (Kurmanji/Northern Kurdish),
// chose one of alternatives as standard and publish them via their book.
// There are 18 Kurdish linguists in the group.
// The group was formed by Mesopotamia Foundation

import moment from '../moment';

function processRelativeTime(num, withoutSuffix, key, isFuture) {
    var format = {
        s: ['çend sanîye', 'çend sanîyeyan'],
        ss: [num + ' sanîye', num + ' sanîyeyan'],
        m: ['deqîqeyek', 'deqîqeyekê'],
        mm: [num + ' deqîqe', num + ' deqîqeyan'],
        h: ['saetek', 'saetekê'],
        hh: [num + ' saet', num + ' saetan'],
        d: ['rojek', 'rojekê'],
        dd: [num + ' roj', num + ' rojan'],
        w: ['hefteyek', 'hefteyekê'],
        ww: [num + ' hefte', num + ' hefteyan'],
        M: ['mehek', 'mehekê'],
        MM: [num + ' meh', num + ' mehan'],
        y: ['salek', 'salekê'],
        yy: [num + ' sal', num + ' salan'],
    };
    return withoutSuffix ? format[key][0] : format[key][1];
}
// function obliqueNumSuffix(num) {
//     if(num.includes(':'))
//         num = parseInt(num.split(':')[0]);
//     else
//         num = parseInt(num);
//     return num == 0 || num % 10 == 1 ? 'ê'
//                         : (num > 10 && num % 10 == 0 ? 'î' : 'an');
// }
function ezafeNumSuffix(num) {
    num = '' + num;
    var l = num.substring(num.length - 1),
        ll = num.length > 1 ? num.substring(num.length - 2) : '';
    if (
        !(ll == 12 || ll == 13) &&
        (l == '2' || l == '3' || ll == '50' || l == '70' || l == '80')
    )
        return 'yê';
    return 'ê';
}

export default moment.defineLocale('ku-kmr', {
    // According to the spelling rules defined by the work group of Weqfa Mezopotamyayê (Mesopotamia Foundation)
    // 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'
    // But the names below are more well known and handy
    months: 'Rêbendan_Sibat_Adar_Nîsan_Gulan_Hezîran_Tîrmeh_Tebax_Îlon_Cotmeh_Mijdar_Berfanbar'.split(
        '_'
    ),
    monthsShort: 'Rêb_Sib_Ada_Nîs_Gul_Hez_Tîr_Teb_Îlo_Cot_Mij_Ber'.split('_'),
    monthsParseExact: true,
    weekdays: 'Yekşem_Duşem_Sêşem_Çarşem_Pêncşem_În_Şemî'.split('_'),
    weekdaysShort: 'Yek_Du_Sê_Çar_Pên_În_Şem'.split('_'),
    weekdaysMin: 'Ye_Du_Sê_Ça_Pê_În_Şe'.split('_'),
    meridiem: function (hours, minutes, isLower) {
        if (hours < 12) {
            return isLower ? 'bn' : 'BN';
        } else {
            return isLower ? 'pn' : 'PN';
        }
    },
    meridiemParse: /bn|BN|pn|PN/,
    longDateFormat: {
        LT: 'HH:mm',
        LTS: 'HH:mm:ss',
        L: 'DD.MM.YYYY',
        LL: 'Do MMMM[a] YYYY[an]',
        LLL: 'Do MMMM[a] YYYY[an] HH:mm',
        LLLL: 'dddd, Do MMMM[a] YYYY[an] HH:mm',
        ll: 'Do MMM[.] YYYY[an]',
        lll: 'Do MMM[.] YYYY[an] HH:mm',
        llll: 'ddd[.], Do MMM[.] YYYY[an] HH:mm',
    },
    calendar: {
        sameDay: '[Îro di saet] LT [de]',
        nextDay: '[Sibê di saet] LT [de]',
        nextWeek: 'dddd [di saet] LT [de]',
        lastDay: '[Duh di saet] LT [de]',
        lastWeek: 'dddd[a borî di saet] LT [de]',
        sameElse: 'L',
    },
    relativeTime: {
        future: 'di %s de',
        past: 'berî %s',
        s: processRelativeTime,
        ss: processRelativeTime,
        m: processRelativeTime,
        mm: processRelativeTime,
        h: processRelativeTime,
        hh: processRelativeTime,
        d: processRelativeTime,
        dd: processRelativeTime,
        w: processRelativeTime,
        ww: processRelativeTime,
        M: processRelativeTime,
        MM: processRelativeTime,
        y: processRelativeTime,
        yy: processRelativeTime,
    },
    dayOfMonthOrdinalParse: /\d{1,2}(?:yê|ê|\.)/,
    ordinal: function (num, period) {
        var p = period.toLowerCase();
        if (p.includes('w') || p.includes('m')) return num + '.';

        return num + ezafeNumSuffix(num);
    },
    week: {
        dow: 1, // Monday is the first day of the week.
        doy: 4, // The week that contains Jan 4th is the first week of the year.
    },
});