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 if (typeof define === 'function' && define.amd) {
8 define(['moment'], factory); // AMD
9 } else if (typeof exports === 'object') {
10 module.exports = factory(require('../moment')); // Node
12 factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
15 var months = 'január_február_marec_apríl_máj_jún_júl_august_september_október_november_december'.split('_'),
16 monthsShort = 'jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec'.split('_');
19 return (n > 1) && (n < 5);
22 function translate(number, withoutSuffix, key, isFuture) {
23 var result = number + ' ';
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 'm': // a minute / in a minute / a minute ago
28 return withoutSuffix ? 'minúta' : (isFuture ? 'minútu' : 'minútou');
29 case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago
30 if (withoutSuffix || isFuture) {
31 return result + (plural(number) ? 'minúty' : 'minút');
33 return result + 'minútami';
36 case 'h': // an hour / in an hour / an hour ago
37 return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou');
38 case 'hh': // 9 hours / in 9 hours / 9 hours ago
39 if (withoutSuffix || isFuture) {
40 return result + (plural(number) ? 'hodiny' : 'hodín');
42 return result + 'hodinami';
45 case 'd': // a day / in a day / a day ago
46 return (withoutSuffix || isFuture) ? 'deň' : 'dňom';
47 case 'dd': // 9 days / in 9 days / 9 days ago
48 if (withoutSuffix || isFuture) {
49 return result + (plural(number) ? 'dni' : 'dní');
51 return result + 'dňami';
54 case 'M': // a month / in a month / a month ago
55 return (withoutSuffix || isFuture) ? 'mesiac' : 'mesiacom';
56 case 'MM': // 9 months / in 9 months / 9 months ago
57 if (withoutSuffix || isFuture) {
58 return result + (plural(number) ? 'mesiace' : 'mesiacov');
60 return result + 'mesiacmi';
63 case 'y': // a year / in a year / a year ago
64 return (withoutSuffix || isFuture) ? 'rok' : 'rokom';
65 case 'yy': // 9 years / in 9 years / 9 years ago
66 if (withoutSuffix || isFuture) {
67 return result + (plural(number) ? 'roky' : 'rokov');
69 return result + 'rokmi';
75 return moment.defineLocale('sk', {
77 monthsShort : monthsShort,
78 monthsParse : (function (months, monthsShort) {
79 var i, _monthsParse = [];
80 for (i = 0; i < 12; i++) {
81 // use custom parser to solve problem with July (červenec)
82 _monthsParse[i] = new RegExp('^' + months[i] + '$|^' + monthsShort[i] + '$', 'i');
85 }(months, monthsShort)),
86 weekdays : 'nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota'.split('_'),
87 weekdaysShort : 'ne_po_ut_st_št_pi_so'.split('_'),
88 weekdaysMin : 'ne_po_ut_st_št_pi_so'.split('_'),
94 LLL : 'D. MMMM YYYY LT',
95 LLLL : 'dddd D. MMMM YYYY LT'
98 sameDay: '[dnes o] LT',
99 nextDay: '[zajtra o] LT',
100 nextWeek: function () {
101 switch (this.day()) {
103 return '[v nedeľu o] LT';
106 return '[v] dddd [o] LT';
108 return '[v stredu o] LT';
110 return '[vo štvrtok o] LT';
112 return '[v piatok o] LT';
114 return '[v sobotu o] LT';
117 lastDay: '[včera o] LT',
118 lastWeek: function () {
119 switch (this.day()) {
121 return '[minulú nedeľu o] LT';
124 return '[minulý] dddd [o] LT';
126 return '[minulú stredu o] LT';
129 return '[minulý] dddd [o] LT';
131 return '[minulú sobotu o] LT';
151 ordinalParse: /\d{1,2}\./,
154 dow : 1, // Monday is the first day of the week.
155 doy : 4 // The week that contains Jan 4th is the first week of the year.