1 // moment.js locale configuration
3 // author : petrbela : https://github.com/petrbela
6 if (typeof define === 'function' && define.amd) {
7 define(['moment'], factory); // AMD
8 } else if (typeof exports === 'object') {
9 module.exports = factory(require('../moment')); // Node
11 factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
14 var months = 'leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec'.split('_'),
15 monthsShort = 'led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro'.split('_');
18 return (n > 1) && (n < 5) && (~~(n / 10) !== 1);
21 function translate(number, withoutSuffix, key, isFuture) {
22 var result = number + ' ';
24 case 's': // a few seconds / in a few seconds / a few seconds ago
25 return (withoutSuffix || isFuture) ? 'pár sekund' : 'pár sekundami';
26 case 'm': // a minute / in a minute / a minute ago
27 return withoutSuffix ? 'minuta' : (isFuture ? 'minutu' : 'minutou');
28 case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago
29 if (withoutSuffix || isFuture) {
30 return result + (plural(number) ? 'minuty' : 'minut');
32 return result + 'minutami';
35 case 'h': // an hour / in an hour / an hour ago
36 return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou');
37 case 'hh': // 9 hours / in 9 hours / 9 hours ago
38 if (withoutSuffix || isFuture) {
39 return result + (plural(number) ? 'hodiny' : 'hodin');
41 return result + 'hodinami';
44 case 'd': // a day / in a day / a day ago
45 return (withoutSuffix || isFuture) ? 'den' : 'dnem';
46 case 'dd': // 9 days / in 9 days / 9 days ago
47 if (withoutSuffix || isFuture) {
48 return result + (plural(number) ? 'dny' : 'dní');
50 return result + 'dny';
53 case 'M': // a month / in a month / a month ago
54 return (withoutSuffix || isFuture) ? 'měsíc' : 'měsícem';
55 case 'MM': // 9 months / in 9 months / 9 months ago
56 if (withoutSuffix || isFuture) {
57 return result + (plural(number) ? 'měsíce' : 'měsíců');
59 return result + 'měsíci';
62 case 'y': // a year / in a year / a year ago
63 return (withoutSuffix || isFuture) ? 'rok' : 'rokem';
64 case 'yy': // 9 years / in 9 years / 9 years ago
65 if (withoutSuffix || isFuture) {
66 return result + (plural(number) ? 'roky' : 'let');
68 return result + 'lety';
74 return moment.defineLocale('cs', {
76 monthsShort : monthsShort,
77 monthsParse : (function (months, monthsShort) {
78 var i, _monthsParse = [];
79 for (i = 0; i < 12; i++) {
80 // use custom parser to solve problem with July (červenec)
81 _monthsParse[i] = new RegExp('^' + months[i] + '$|^' + monthsShort[i] + '$', 'i');
84 }(months, monthsShort)),
85 weekdays : 'neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota'.split('_'),
86 weekdaysShort : 'ne_po_út_st_čt_pá_so'.split('_'),
87 weekdaysMin : 'ne_po_út_st_čt_pá_so'.split('_'),
93 LLL : 'D. MMMM YYYY LT',
94 LLLL : 'dddd D. MMMM YYYY LT'
97 sameDay: '[dnes v] LT',
98 nextDay: '[zítra v] LT',
99 nextWeek: function () {
100 switch (this.day()) {
102 return '[v neděli v] LT';
105 return '[v] dddd [v] LT';
107 return '[ve středu v] LT';
109 return '[ve čtvrtek v] LT';
111 return '[v pátek v] LT';
113 return '[v sobotu v] LT';
116 lastDay: '[včera v] LT',
117 lastWeek: function () {
118 switch (this.day()) {
120 return '[minulou neděli v] LT';
123 return '[minulé] dddd [v] LT';
125 return '[minulou středu v] LT';
128 return '[minulý] dddd [v] LT';
130 return '[minulou sobotu v] LT';
150 ordinalParse : /\d{1,2}\./,
153 dow : 1, // Monday is the first day of the week.
154 doy : 4 // The week that contains Jan 4th is the first week of the year.