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
7 // Comment out broken wrapper, see T145382
8 /*if (typeof define === 'function' && define.amd) {
9 define(['moment'], factory); // AMD
10 } else if (typeof exports === 'object') {
11 module.exports = factory(require('../moment')); // Node
13 factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
17 var months
= 'január_február_marec_apríl_máj_jún_júl_august_september_október_november_december'.split('_'),
18 monthsShort
= 'jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec'.split('_');
21 return (n
> 1) && (n
< 5);
24 function translate(number
, withoutSuffix
, key
, isFuture
) {
25 var result
= number
+ ' ';
27 case 's': // a few seconds / in a few seconds / a few seconds ago
28 return (withoutSuffix
|| isFuture
) ? 'pár sekúnd' : 'pár sekundami';
29 case 'm': // a minute / in a minute / a minute ago
30 return withoutSuffix
? 'minúta' : (isFuture
? 'minútu' : 'minútou');
31 case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago
32 if (withoutSuffix
|| isFuture
) {
33 return result
+ (plural(number
) ? 'minúty' : 'minút');
35 return result
+ 'minútami';
38 case 'h': // an hour / in an hour / an hour ago
39 return withoutSuffix
? 'hodina' : (isFuture
? 'hodinu' : 'hodinou');
40 case 'hh': // 9 hours / in 9 hours / 9 hours ago
41 if (withoutSuffix
|| isFuture
) {
42 return result
+ (plural(number
) ? 'hodiny' : 'hodín');
44 return result
+ 'hodinami';
47 case 'd': // a day / in a day / a day ago
48 return (withoutSuffix
|| isFuture
) ? 'deň' : 'dňom';
49 case 'dd': // 9 days / in 9 days / 9 days ago
50 if (withoutSuffix
|| isFuture
) {
51 return result
+ (plural(number
) ? 'dni' : 'dní');
53 return result
+ 'dňami';
56 case 'M': // a month / in a month / a month ago
57 return (withoutSuffix
|| isFuture
) ? 'mesiac' : 'mesiacom';
58 case 'MM': // 9 months / in 9 months / 9 months ago
59 if (withoutSuffix
|| isFuture
) {
60 return result
+ (plural(number
) ? 'mesiace' : 'mesiacov');
62 return result
+ 'mesiacmi';
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');
71 return result
+ 'rokmi';
77 return moment
.defineLocale('sk', {
79 monthsShort
: monthsShort
,
80 monthsParse
: (function (months
, monthsShort
) {
81 var i
, _monthsParse
= [];
82 for (i
= 0; i
< 12; i
++) {
83 // use custom parser to solve problem with July (červenec)
84 _monthsParse
[i
] = new RegExp('^' + months
[i
] + '$|^' + monthsShort
[i
] + '$', 'i');
87 }(months
, monthsShort
)),
88 weekdays
: 'nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota'.split('_'),
89 weekdaysShort
: 'ne_po_ut_st_št_pi_so'.split('_'),
90 weekdaysMin
: 'ne_po_ut_st_št_pi_so'.split('_'),
96 LLL
: 'D. MMMM YYYY LT',
97 LLLL
: 'dddd D. MMMM YYYY LT'
100 sameDay
: '[dnes o] LT',
101 nextDay
: '[zajtra o] LT',
102 nextWeek: function () {
103 switch (this.day()) {
105 return '[v nedeľu o] LT';
108 return '[v] dddd [o] LT';
110 return '[v stredu o] LT';
112 return '[vo štvrtok o] LT';
114 return '[v piatok o] LT';
116 return '[v sobotu o] LT';
119 lastDay
: '[včera o] LT',
120 lastWeek: function () {
121 switch (this.day()) {
123 return '[minulú nedeľu o] LT';
126 return '[minulý] dddd [o] LT';
128 return '[minulú stredu o] LT';
131 return '[minulý] dddd [o] LT';
133 return '[minulú sobotu o] LT';
153 ordinalParse
: /\d{1,2}\./,
156 dow
: 1, // Monday is the first day of the week.
157 doy
: 4 // The week that contains Jan 4th is the first week of the year.