GPQAPP

Форк
0
129 строк · 4.3 Кб
1
//! moment.js locale configuration
2
//! locale : Montenegrin [me]
3
//! author : Miodrag Nikač <miodrag@restartit.me> : https://github.com/miodragnikac
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
    var translator = {
15
        words: {
16
            //Different grammatical cases
17
            ss: ['sekund', 'sekunda', 'sekundi'],
18
            m: ['jedan minut', 'jednog minuta'],
19
            mm: ['minut', 'minuta', 'minuta'],
20
            h: ['jedan sat', 'jednog sata'],
21
            hh: ['sat', 'sata', 'sati'],
22
            dd: ['dan', 'dana', 'dana'],
23
            MM: ['mjesec', 'mjeseca', 'mjeseci'],
24
            yy: ['godina', 'godine', 'godina'],
25
        },
26
        correctGrammaticalCase: function (number, wordKey) {
27
            return number === 1
28
                ? wordKey[0]
29
                : number >= 2 && number <= 4
30
                ? wordKey[1]
31
                : wordKey[2];
32
        },
33
        translate: function (number, withoutSuffix, key) {
34
            var wordKey = translator.words[key];
35
            if (key.length === 1) {
36
                return withoutSuffix ? wordKey[0] : wordKey[1];
37
            } else {
38
                return (
39
                    number +
40
                    ' ' +
41
                    translator.correctGrammaticalCase(number, wordKey)
42
                );
43
            }
44
        },
45
    };
46

47
    var me = moment.defineLocale('me', {
48
        months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split(
49
            '_'
50
        ),
51
        monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split(
52
            '_'
53
        ),
54
        monthsParseExact: true,
55
        weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split(
56
            '_'
57
        ),
58
        weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
59
        weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
60
        weekdaysParseExact: true,
61
        longDateFormat: {
62
            LT: 'H:mm',
63
            LTS: 'H:mm:ss',
64
            L: 'DD.MM.YYYY',
65
            LL: 'D. MMMM YYYY',
66
            LLL: 'D. MMMM YYYY H:mm',
67
            LLLL: 'dddd, D. MMMM YYYY H:mm',
68
        },
69
        calendar: {
70
            sameDay: '[danas u] LT',
71
            nextDay: '[sjutra u] LT',
72

73
            nextWeek: function () {
74
                switch (this.day()) {
75
                    case 0:
76
                        return '[u] [nedjelju] [u] LT';
77
                    case 3:
78
                        return '[u] [srijedu] [u] LT';
79
                    case 6:
80
                        return '[u] [subotu] [u] LT';
81
                    case 1:
82
                    case 2:
83
                    case 4:
84
                    case 5:
85
                        return '[u] dddd [u] LT';
86
                }
87
            },
88
            lastDay: '[juče u] LT',
89
            lastWeek: function () {
90
                var lastWeekDays = [
91
                    '[prošle] [nedjelje] [u] LT',
92
                    '[prošlog] [ponedjeljka] [u] LT',
93
                    '[prošlog] [utorka] [u] LT',
94
                    '[prošle] [srijede] [u] LT',
95
                    '[prošlog] [četvrtka] [u] LT',
96
                    '[prošlog] [petka] [u] LT',
97
                    '[prošle] [subote] [u] LT',
98
                ];
99
                return lastWeekDays[this.day()];
100
            },
101
            sameElse: 'L',
102
        },
103
        relativeTime: {
104
            future: 'za %s',
105
            past: 'prije %s',
106
            s: 'nekoliko sekundi',
107
            ss: translator.translate,
108
            m: translator.translate,
109
            mm: translator.translate,
110
            h: translator.translate,
111
            hh: translator.translate,
112
            d: 'dan',
113
            dd: translator.translate,
114
            M: 'mjesec',
115
            MM: translator.translate,
116
            y: 'godinu',
117
            yy: translator.translate,
118
        },
119
        dayOfMonthOrdinalParse: /\d{1,2}\./,
120
        ordinal: '%d.',
121
        week: {
122
            dow: 1, // Monday is the first day of the week.
123
            doy: 7, // The week that contains Jan 7th is the first week of the year.
124
        },
125
    });
126

127
    return me;
128

129
})));
130

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

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

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

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