GPQAPP

Форк
0
181 строка · 6.9 Кб
1
//! moment.js locale configuration
2
//! locale : Slovenian [sl]
3
//! author : Robert Sedovšek : https://github.com/sedovsek
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 processRelativeTime(number, withoutSuffix, key, isFuture) {
15
        var result = number + ' ';
16
        switch (key) {
17
            case 's':
18
                return withoutSuffix || isFuture
19
                    ? 'nekaj sekund'
20
                    : 'nekaj sekundami';
21
            case 'ss':
22
                if (number === 1) {
23
                    result += withoutSuffix ? 'sekundo' : 'sekundi';
24
                } else if (number === 2) {
25
                    result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';
26
                } else if (number < 5) {
27
                    result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';
28
                } else {
29
                    result += 'sekund';
30
                }
31
                return result;
32
            case 'm':
33
                return withoutSuffix ? 'ena minuta' : 'eno minuto';
34
            case 'mm':
35
                if (number === 1) {
36
                    result += withoutSuffix ? 'minuta' : 'minuto';
37
                } else if (number === 2) {
38
                    result += withoutSuffix || isFuture ? 'minuti' : 'minutama';
39
                } else if (number < 5) {
40
                    result += withoutSuffix || isFuture ? 'minute' : 'minutami';
41
                } else {
42
                    result += withoutSuffix || isFuture ? 'minut' : 'minutami';
43
                }
44
                return result;
45
            case 'h':
46
                return withoutSuffix ? 'ena ura' : 'eno uro';
47
            case 'hh':
48
                if (number === 1) {
49
                    result += withoutSuffix ? 'ura' : 'uro';
50
                } else if (number === 2) {
51
                    result += withoutSuffix || isFuture ? 'uri' : 'urama';
52
                } else if (number < 5) {
53
                    result += withoutSuffix || isFuture ? 'ure' : 'urami';
54
                } else {
55
                    result += withoutSuffix || isFuture ? 'ur' : 'urami';
56
                }
57
                return result;
58
            case 'd':
59
                return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';
60
            case 'dd':
61
                if (number === 1) {
62
                    result += withoutSuffix || isFuture ? 'dan' : 'dnem';
63
                } else if (number === 2) {
64
                    result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';
65
                } else {
66
                    result += withoutSuffix || isFuture ? 'dni' : 'dnevi';
67
                }
68
                return result;
69
            case 'M':
70
                return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';
71
            case 'MM':
72
                if (number === 1) {
73
                    result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';
74
                } else if (number === 2) {
75
                    result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';
76
                } else if (number < 5) {
77
                    result += withoutSuffix || isFuture ? 'mesece' : 'meseci';
78
                } else {
79
                    result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';
80
                }
81
                return result;
82
            case 'y':
83
                return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';
84
            case 'yy':
85
                if (number === 1) {
86
                    result += withoutSuffix || isFuture ? 'leto' : 'letom';
87
                } else if (number === 2) {
88
                    result += withoutSuffix || isFuture ? 'leti' : 'letoma';
89
                } else if (number < 5) {
90
                    result += withoutSuffix || isFuture ? 'leta' : 'leti';
91
                } else {
92
                    result += withoutSuffix || isFuture ? 'let' : 'leti';
93
                }
94
                return result;
95
        }
96
    }
97

98
    var sl = moment.defineLocale('sl', {
99
        months: 'januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december'.split(
100
            '_'
101
        ),
102
        monthsShort: 'jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.'.split(
103
            '_'
104
        ),
105
        monthsParseExact: true,
106
        weekdays: 'nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota'.split('_'),
107
        weekdaysShort: 'ned._pon._tor._sre._čet._pet._sob.'.split('_'),
108
        weekdaysMin: 'ne_po_to_sr_če_pe_so'.split('_'),
109
        weekdaysParseExact: true,
110
        longDateFormat: {
111
            LT: 'H:mm',
112
            LTS: 'H:mm:ss',
113
            L: 'DD. MM. YYYY',
114
            LL: 'D. MMMM YYYY',
115
            LLL: 'D. MMMM YYYY H:mm',
116
            LLLL: 'dddd, D. MMMM YYYY H:mm',
117
        },
118
        calendar: {
119
            sameDay: '[danes ob] LT',
120
            nextDay: '[jutri ob] LT',
121

122
            nextWeek: function () {
123
                switch (this.day()) {
124
                    case 0:
125
                        return '[v] [nedeljo] [ob] LT';
126
                    case 3:
127
                        return '[v] [sredo] [ob] LT';
128
                    case 6:
129
                        return '[v] [soboto] [ob] LT';
130
                    case 1:
131
                    case 2:
132
                    case 4:
133
                    case 5:
134
                        return '[v] dddd [ob] LT';
135
                }
136
            },
137
            lastDay: '[včeraj ob] LT',
138
            lastWeek: function () {
139
                switch (this.day()) {
140
                    case 0:
141
                        return '[prejšnjo] [nedeljo] [ob] LT';
142
                    case 3:
143
                        return '[prejšnjo] [sredo] [ob] LT';
144
                    case 6:
145
                        return '[prejšnjo] [soboto] [ob] LT';
146
                    case 1:
147
                    case 2:
148
                    case 4:
149
                    case 5:
150
                        return '[prejšnji] dddd [ob] LT';
151
                }
152
            },
153
            sameElse: 'L',
154
        },
155
        relativeTime: {
156
            future: 'čez %s',
157
            past: 'pred %s',
158
            s: processRelativeTime,
159
            ss: processRelativeTime,
160
            m: processRelativeTime,
161
            mm: processRelativeTime,
162
            h: processRelativeTime,
163
            hh: processRelativeTime,
164
            d: processRelativeTime,
165
            dd: processRelativeTime,
166
            M: processRelativeTime,
167
            MM: processRelativeTime,
168
            y: processRelativeTime,
169
            yy: processRelativeTime,
170
        },
171
        dayOfMonthOrdinalParse: /\d{1,2}\./,
172
        ordinal: '%d.',
173
        week: {
174
            dow: 1, // Monday is the first day of the week.
175
            doy: 7, // The week that contains Jan 7th is the first week of the year.
176
        },
177
    });
178

179
    return sl;
180

181
})));
182

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

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

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

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