GPQAPP

Форк
0
146 строк · 5.0 Кб
1
//! moment.js locale configuration
2
//! locale : Luxembourgish [lb]
3
//! author : mweimerskirch : https://github.com/mweimerskirch
4
//! author : David Raison : https://github.com/kwisatz
5

6
;(function (global, factory) {
7
   typeof exports === 'object' && typeof module !== 'undefined'
8
       && typeof require === 'function' ? factory(require('../moment')) :
9
   typeof define === 'function' && define.amd ? define(['../moment'], factory) :
10
   factory(global.moment)
11
}(this, (function (moment) { 'use strict';
12

13
    //! moment.js locale configuration
14

15
    function processRelativeTime(number, withoutSuffix, key, isFuture) {
16
        var format = {
17
            m: ['eng Minutt', 'enger Minutt'],
18
            h: ['eng Stonn', 'enger Stonn'],
19
            d: ['een Dag', 'engem Dag'],
20
            M: ['ee Mount', 'engem Mount'],
21
            y: ['ee Joer', 'engem Joer'],
22
        };
23
        return withoutSuffix ? format[key][0] : format[key][1];
24
    }
25
    function processFutureTime(string) {
26
        var number = string.substr(0, string.indexOf(' '));
27
        if (eifelerRegelAppliesToNumber(number)) {
28
            return 'a ' + string;
29
        }
30
        return 'an ' + string;
31
    }
32
    function processPastTime(string) {
33
        var number = string.substr(0, string.indexOf(' '));
34
        if (eifelerRegelAppliesToNumber(number)) {
35
            return 'viru ' + string;
36
        }
37
        return 'virun ' + string;
38
    }
39
    /**
40
     * Returns true if the word before the given number loses the '-n' ending.
41
     * e.g. 'an 10 Deeg' but 'a 5 Deeg'
42
     *
43
     * @param number {integer}
44
     * @returns {boolean}
45
     */
46
    function eifelerRegelAppliesToNumber(number) {
47
        number = parseInt(number, 10);
48
        if (isNaN(number)) {
49
            return false;
50
        }
51
        if (number < 0) {
52
            // Negative Number --> always true
53
            return true;
54
        } else if (number < 10) {
55
            // Only 1 digit
56
            if (4 <= number && number <= 7) {
57
                return true;
58
            }
59
            return false;
60
        } else if (number < 100) {
61
            // 2 digits
62
            var lastDigit = number % 10,
63
                firstDigit = number / 10;
64
            if (lastDigit === 0) {
65
                return eifelerRegelAppliesToNumber(firstDigit);
66
            }
67
            return eifelerRegelAppliesToNumber(lastDigit);
68
        } else if (number < 10000) {
69
            // 3 or 4 digits --> recursively check first digit
70
            while (number >= 10) {
71
                number = number / 10;
72
            }
73
            return eifelerRegelAppliesToNumber(number);
74
        } else {
75
            // Anything larger than 4 digits: recursively check first n-3 digits
76
            number = number / 1000;
77
            return eifelerRegelAppliesToNumber(number);
78
        }
79
    }
80

81
    var lb = moment.defineLocale('lb', {
82
        months: 'Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember'.split(
83
            '_'
84
        ),
85
        monthsShort: 'Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split(
86
            '_'
87
        ),
88
        monthsParseExact: true,
89
        weekdays: 'Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg'.split(
90
            '_'
91
        ),
92
        weekdaysShort: 'So._Mé._Dë._Më._Do._Fr._Sa.'.split('_'),
93
        weekdaysMin: 'So_Mé_Dë_Më_Do_Fr_Sa'.split('_'),
94
        weekdaysParseExact: true,
95
        longDateFormat: {
96
            LT: 'H:mm [Auer]',
97
            LTS: 'H:mm:ss [Auer]',
98
            L: 'DD.MM.YYYY',
99
            LL: 'D. MMMM YYYY',
100
            LLL: 'D. MMMM YYYY H:mm [Auer]',
101
            LLLL: 'dddd, D. MMMM YYYY H:mm [Auer]',
102
        },
103
        calendar: {
104
            sameDay: '[Haut um] LT',
105
            sameElse: 'L',
106
            nextDay: '[Muer um] LT',
107
            nextWeek: 'dddd [um] LT',
108
            lastDay: '[Gëschter um] LT',
109
            lastWeek: function () {
110
                // Different date string for 'Dënschdeg' (Tuesday) and 'Donneschdeg' (Thursday) due to phonological rule
111
                switch (this.day()) {
112
                    case 2:
113
                    case 4:
114
                        return '[Leschten] dddd [um] LT';
115
                    default:
116
                        return '[Leschte] dddd [um] LT';
117
                }
118
            },
119
        },
120
        relativeTime: {
121
            future: processFutureTime,
122
            past: processPastTime,
123
            s: 'e puer Sekonnen',
124
            ss: '%d Sekonnen',
125
            m: processRelativeTime,
126
            mm: '%d Minutten',
127
            h: processRelativeTime,
128
            hh: '%d Stonnen',
129
            d: processRelativeTime,
130
            dd: '%d Deeg',
131
            M: processRelativeTime,
132
            MM: '%d Méint',
133
            y: processRelativeTime,
134
            yy: '%d Joer',
135
        },
136
        dayOfMonthOrdinalParse: /\d{1,2}\./,
137
        ordinal: '%d.',
138
        week: {
139
            dow: 1, // Monday is the first day of the week.
140
            doy: 4, // The week that contains Jan 4th is the first week of the year.
141
        },
142
    });
143

144
    return lb;
145

146
})));
147

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.