LaravelTest

Форк
0
176 строк · 5.4 Кб
1
//! moment.js locale configuration
2
//! locale : Breton [br]
3
//! author : Jean-Baptiste Le Duigou : https://github.com/jbleduigou
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 relativeTimeWithMutation(number, withoutSuffix, key) {
15
        var format = {
16
            mm: 'munutenn',
17
            MM: 'miz',
18
            dd: 'devezh',
19
        };
20
        return number + ' ' + mutation(format[key], number);
21
    }
22
    function specialMutationForYears(number) {
23
        switch (lastNumber(number)) {
24
            case 1:
25
            case 3:
26
            case 4:
27
            case 5:
28
            case 9:
29
                return number + ' bloaz';
30
            default:
31
                return number + ' vloaz';
32
        }
33
    }
34
    function lastNumber(number) {
35
        if (number > 9) {
36
            return lastNumber(number % 10);
37
        }
38
        return number;
39
    }
40
    function mutation(text, number) {
41
        if (number === 2) {
42
            return softMutation(text);
43
        }
44
        return text;
45
    }
46
    function softMutation(text) {
47
        var mutationTable = {
48
            m: 'v',
49
            b: 'v',
50
            d: 'z',
51
        };
52
        if (mutationTable[text.charAt(0)] === undefined) {
53
            return text;
54
        }
55
        return mutationTable[text.charAt(0)] + text.substring(1);
56
    }
57

58
    var monthsParse = [
59
            /^gen/i,
60
            /^c[ʼ\']hwe/i,
61
            /^meu/i,
62
            /^ebr/i,
63
            /^mae/i,
64
            /^(mez|eve)/i,
65
            /^gou/i,
66
            /^eos/i,
67
            /^gwe/i,
68
            /^her/i,
69
            /^du/i,
70
            /^ker/i,
71
        ],
72
        monthsRegex = /^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu|gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,
73
        monthsStrictRegex = /^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu)/i,
74
        monthsShortStrictRegex = /^(gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,
75
        fullWeekdaysParse = [
76
            /^sul/i,
77
            /^lun/i,
78
            /^meurzh/i,
79
            /^merc[ʼ\']her/i,
80
            /^yaou/i,
81
            /^gwener/i,
82
            /^sadorn/i,
83
        ],
84
        shortWeekdaysParse = [
85
            /^Sul/i,
86
            /^Lun/i,
87
            /^Meu/i,
88
            /^Mer/i,
89
            /^Yao/i,
90
            /^Gwe/i,
91
            /^Sad/i,
92
        ],
93
        minWeekdaysParse = [
94
            /^Su/i,
95
            /^Lu/i,
96
            /^Me([^r]|$)/i,
97
            /^Mer/i,
98
            /^Ya/i,
99
            /^Gw/i,
100
            /^Sa/i,
101
        ];
102

103
    var br = moment.defineLocale('br', {
104
        months: 'Genver_Cʼhwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu'.split(
105
            '_'
106
        ),
107
        monthsShort: 'Gen_Cʼhwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker'.split('_'),
108
        weekdays: 'Sul_Lun_Meurzh_Mercʼher_Yaou_Gwener_Sadorn'.split('_'),
109
        weekdaysShort: 'Sul_Lun_Meu_Mer_Yao_Gwe_Sad'.split('_'),
110
        weekdaysMin: 'Su_Lu_Me_Mer_Ya_Gw_Sa'.split('_'),
111
        weekdaysParse: minWeekdaysParse,
112
        fullWeekdaysParse: fullWeekdaysParse,
113
        shortWeekdaysParse: shortWeekdaysParse,
114
        minWeekdaysParse: minWeekdaysParse,
115

116
        monthsRegex: monthsRegex,
117
        monthsShortRegex: monthsRegex,
118
        monthsStrictRegex: monthsStrictRegex,
119
        monthsShortStrictRegex: monthsShortStrictRegex,
120
        monthsParse: monthsParse,
121
        longMonthsParse: monthsParse,
122
        shortMonthsParse: monthsParse,
123

124
        longDateFormat: {
125
            LT: 'HH:mm',
126
            LTS: 'HH:mm:ss',
127
            L: 'DD/MM/YYYY',
128
            LL: 'D [a viz] MMMM YYYY',
129
            LLL: 'D [a viz] MMMM YYYY HH:mm',
130
            LLLL: 'dddd, D [a viz] MMMM YYYY HH:mm',
131
        },
132
        calendar: {
133
            sameDay: '[Hiziv da] LT',
134
            nextDay: '[Warcʼhoazh da] LT',
135
            nextWeek: 'dddd [da] LT',
136
            lastDay: '[Decʼh da] LT',
137
            lastWeek: 'dddd [paset da] LT',
138
            sameElse: 'L',
139
        },
140
        relativeTime: {
141
            future: 'a-benn %s',
142
            past: '%s ʼzo',
143
            s: 'un nebeud segondennoù',
144
            ss: '%d eilenn',
145
            m: 'ur vunutenn',
146
            mm: relativeTimeWithMutation,
147
            h: 'un eur',
148
            hh: '%d eur',
149
            d: 'un devezh',
150
            dd: relativeTimeWithMutation,
151
            M: 'ur miz',
152
            MM: relativeTimeWithMutation,
153
            y: 'ur bloaz',
154
            yy: specialMutationForYears,
155
        },
156
        dayOfMonthOrdinalParse: /\d{1,2}(añ|vet)/,
157
        ordinal: function (number) {
158
            var output = number === 1 ? 'añ' : 'vet';
159
            return number + output;
160
        },
161
        week: {
162
            dow: 1, // Monday is the first day of the week.
163
            doy: 4, // The week that contains Jan 4th is the first week of the year.
164
        },
165
        meridiemParse: /a.m.|g.m./, // goude merenn | a-raok merenn
166
        isPM: function (token) {
167
            return token === 'g.m.';
168
        },
169
        meridiem: function (hour, minute, isLower) {
170
            return hour < 12 ? 'a.m.' : 'g.m.';
171
        },
172
    });
173

174
    return br;
175

176
})));
177

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

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

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

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