GPQAPP

Форк
0
155 строк · 5.9 Кб
1
//! moment.js locale configuration
2
//! locale : Slovak [sk]
3
//! author : Martin Minka : https://github.com/k2s
4
//! based on work of petrbela : https://github.com/petrbela
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 months = 'január_február_marec_apríl_máj_jún_júl_august_september_október_november_december'.split(
16
            '_'
17
        ),
18
        monthsShort = 'jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec'.split('_');
19
    function plural(n) {
20
        return n > 1 && n < 5;
21
    }
22
    function translate(number, withoutSuffix, key, isFuture) {
23
        var result = number + ' ';
24
        switch (key) {
25
            case 's': // a few seconds / in a few seconds / a few seconds ago
26
                return withoutSuffix || isFuture ? 'pár sekúnd' : 'pár sekundami';
27
            case 'ss': // 9 seconds / in 9 seconds / 9 seconds ago
28
                if (withoutSuffix || isFuture) {
29
                    return result + (plural(number) ? 'sekundy' : 'sekúnd');
30
                } else {
31
                    return result + 'sekundami';
32
                }
33
            case 'm': // a minute / in a minute / a minute ago
34
                return withoutSuffix ? 'minúta' : isFuture ? 'minútu' : 'minútou';
35
            case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago
36
                if (withoutSuffix || isFuture) {
37
                    return result + (plural(number) ? 'minúty' : 'minút');
38
                } else {
39
                    return result + 'minútami';
40
                }
41
            case 'h': // an hour / in an hour / an hour ago
42
                return withoutSuffix ? 'hodina' : isFuture ? 'hodinu' : 'hodinou';
43
            case 'hh': // 9 hours / in 9 hours / 9 hours ago
44
                if (withoutSuffix || isFuture) {
45
                    return result + (plural(number) ? 'hodiny' : 'hodín');
46
                } else {
47
                    return result + 'hodinami';
48
                }
49
            case 'd': // a day / in a day / a day ago
50
                return withoutSuffix || isFuture ? 'deň' : 'dňom';
51
            case 'dd': // 9 days / in 9 days / 9 days ago
52
                if (withoutSuffix || isFuture) {
53
                    return result + (plural(number) ? 'dni' : 'dní');
54
                } else {
55
                    return result + 'dňami';
56
                }
57
            case 'M': // a month / in a month / a month ago
58
                return withoutSuffix || isFuture ? 'mesiac' : 'mesiacom';
59
            case 'MM': // 9 months / in 9 months / 9 months ago
60
                if (withoutSuffix || isFuture) {
61
                    return result + (plural(number) ? 'mesiace' : 'mesiacov');
62
                } else {
63
                    return result + 'mesiacmi';
64
                }
65
            case 'y': // a year / in a year / a year ago
66
                return withoutSuffix || isFuture ? 'rok' : 'rokom';
67
            case 'yy': // 9 years / in 9 years / 9 years ago
68
                if (withoutSuffix || isFuture) {
69
                    return result + (plural(number) ? 'roky' : 'rokov');
70
                } else {
71
                    return result + 'rokmi';
72
                }
73
        }
74
    }
75

76
    var sk = moment.defineLocale('sk', {
77
        months: months,
78
        monthsShort: monthsShort,
79
        weekdays: 'nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota'.split('_'),
80
        weekdaysShort: 'ne_po_ut_st_št_pi_so'.split('_'),
81
        weekdaysMin: 'ne_po_ut_st_št_pi_so'.split('_'),
82
        longDateFormat: {
83
            LT: 'H:mm',
84
            LTS: 'H:mm:ss',
85
            L: 'DD.MM.YYYY',
86
            LL: 'D. MMMM YYYY',
87
            LLL: 'D. MMMM YYYY H:mm',
88
            LLLL: 'dddd D. MMMM YYYY H:mm',
89
        },
90
        calendar: {
91
            sameDay: '[dnes o] LT',
92
            nextDay: '[zajtra o] LT',
93
            nextWeek: function () {
94
                switch (this.day()) {
95
                    case 0:
96
                        return '[v nedeľu o] LT';
97
                    case 1:
98
                    case 2:
99
                        return '[v] dddd [o] LT';
100
                    case 3:
101
                        return '[v stredu o] LT';
102
                    case 4:
103
                        return '[vo štvrtok o] LT';
104
                    case 5:
105
                        return '[v piatok o] LT';
106
                    case 6:
107
                        return '[v sobotu o] LT';
108
                }
109
            },
110
            lastDay: '[včera o] LT',
111
            lastWeek: function () {
112
                switch (this.day()) {
113
                    case 0:
114
                        return '[minulú nedeľu o] LT';
115
                    case 1:
116
                    case 2:
117
                        return '[minulý] dddd [o] LT';
118
                    case 3:
119
                        return '[minulú stredu o] LT';
120
                    case 4:
121
                    case 5:
122
                        return '[minulý] dddd [o] LT';
123
                    case 6:
124
                        return '[minulú sobotu o] LT';
125
                }
126
            },
127
            sameElse: 'L',
128
        },
129
        relativeTime: {
130
            future: 'za %s',
131
            past: 'pred %s',
132
            s: translate,
133
            ss: translate,
134
            m: translate,
135
            mm: translate,
136
            h: translate,
137
            hh: translate,
138
            d: translate,
139
            dd: translate,
140
            M: translate,
141
            MM: translate,
142
            y: translate,
143
            yy: translate,
144
        },
145
        dayOfMonthOrdinalParse: /\d{1,2}\./,
146
        ordinal: '%d.',
147
        week: {
148
            dow: 1, // Monday is the first day of the week.
149
            doy: 4, // The week that contains Jan 4th is the first week of the year.
150
        },
151
    });
152

153
    return sk;
154

155
})));
156

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

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

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

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