LaravelTest

Форк
0
129 строк · 4.4 Кб
1
//! moment.js locale configuration
2
//! locale : Serbian [sr]
3
//! author : Milan Janačković<milanjanackovic@gmail.com> : https://github.com/milan-j
4
//! author : Stefan Crnjaković <stefan@hotmail.rs> : https://github.com/crnjakovic
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
    var translator = {
16
        words: {
17
            //Different grammatical cases
18
            ss: ['sekunda', 'sekunde', 'sekundi'],
19
            m: ['jedan minut', 'jedne minute'],
20
            mm: ['minut', 'minute', 'minuta'],
21
            h: ['jedan sat', 'jednog sata'],
22
            hh: ['sat', 'sata', 'sati'],
23
            dd: ['dan', 'dana', 'dana'],
24
            MM: ['mesec', 'meseca', 'meseci'],
25
            yy: ['godina', 'godine', 'godina'],
26
        },
27
        correctGrammaticalCase: function (number, wordKey) {
28
            return number === 1
29
                ? wordKey[0]
30
                : number >= 2 && number <= 4
31
                ? wordKey[1]
32
                : wordKey[2];
33
        },
34
        translate: function (number, withoutSuffix, key) {
35
            var wordKey = translator.words[key];
36
            if (key.length === 1) {
37
                return withoutSuffix ? wordKey[0] : wordKey[1];
38
            } else {
39
                return (
40
                    number +
41
                    ' ' +
42
                    translator.correctGrammaticalCase(number, wordKey)
43
                );
44
            }
45
        },
46
    };
47

48
    var sr = moment.defineLocale('sr', {
49
        months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split(
50
            '_'
51
        ),
52
        monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split(
53
            '_'
54
        ),
55
        monthsParseExact: true,
56
        weekdays: 'nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota'.split(
57
            '_'
58
        ),
59
        weekdaysShort: 'ned._pon._uto._sre._čet._pet._sub.'.split('_'),
60
        weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
61
        weekdaysParseExact: true,
62
        longDateFormat: {
63
            LT: 'H:mm',
64
            LTS: 'H:mm:ss',
65
            L: 'D. M. YYYY.',
66
            LL: 'D. MMMM YYYY.',
67
            LLL: 'D. MMMM YYYY. H:mm',
68
            LLLL: 'dddd, D. MMMM YYYY. H:mm',
69
        },
70
        calendar: {
71
            sameDay: '[danas u] LT',
72
            nextDay: '[sutra u] LT',
73
            nextWeek: function () {
74
                switch (this.day()) {
75
                    case 0:
76
                        return '[u] [nedelju] [u] LT';
77
                    case 3:
78
                        return '[u] [sredu] [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] [nedelje] [u] LT',
92
                    '[prošlog] [ponedeljka] [u] LT',
93
                    '[prošlog] [utorka] [u] LT',
94
                    '[prošle] [srede] [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: 'pre %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: 'mesec',
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 sr;
128

129
})));
130

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

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

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

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