1 //! moment.js locale configuration
2 //! locale : czech (cs)
3 //! author : petrbela : https://github.com/petrbela
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) :
10 }(this, function (moment) { 'use strict';
13 var months = 'leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec'.split('_'),
14 monthsShort = 'led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro'.split('_');
16 return (n > 1) && (n < 5) && (~~(n / 10) !== 1);
18 function translate(number, withoutSuffix, key, isFuture) {
19 var result = number + ' ';
21 case 's': // a few seconds / in a few seconds / a few seconds ago
22 return (withoutSuffix || isFuture) ? 'pár sekund' : 'pár sekundami';
23 case 'm': // a minute / in a minute / a minute ago
24 return withoutSuffix ? 'minuta' : (isFuture ? 'minutu' : 'minutou');
25 case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago
26 if (withoutSuffix || isFuture) {
27 return result + (plural(number) ? 'minuty' : 'minut');
29 return result + 'minutami';
32 case 'h': // an hour / in an hour / an hour ago
33 return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou');
34 case 'hh': // 9 hours / in 9 hours / 9 hours ago
35 if (withoutSuffix || isFuture) {
36 return result + (plural(number) ? 'hodiny' : 'hodin');
38 return result + 'hodinami';
41 case 'd': // a day / in a day / a day ago
42 return (withoutSuffix || isFuture) ? 'den' : 'dnem';
43 case 'dd': // 9 days / in 9 days / 9 days ago
44 if (withoutSuffix || isFuture) {
45 return result + (plural(number) ? 'dny' : 'dní');
47 return result + 'dny';
50 case 'M': // a month / in a month / a month ago
51 return (withoutSuffix || isFuture) ? 'měsíc' : 'měsícem';
52 case 'MM': // 9 months / in 9 months / 9 months ago
53 if (withoutSuffix || isFuture) {
54 return result + (plural(number) ? 'měsíce' : 'měsíců');
56 return result + 'měsíci';
59 case 'y': // a year / in a year / a year ago
60 return (withoutSuffix || isFuture) ? 'rok' : 'rokem';
61 case 'yy': // 9 years / in 9 years / 9 years ago
62 if (withoutSuffix || isFuture) {
63 return result + (plural(number) ? 'roky' : 'let');
65 return result + 'lety';
71 var cs = moment.defineLocale('cs', {
73 monthsShort : monthsShort,
74 monthsParse : (function (months, monthsShort) {
75 var i, _monthsParse = [];
76 for (i = 0; i < 12; i++) {
77 // use custom parser to solve problem with July (červenec)
78 _monthsParse[i] = new RegExp('^' + months[i] + '$|^' + monthsShort[i] + '$', 'i');
81 }(months, monthsShort)),
82 shortMonthsParse : (function (monthsShort) {
83 var i, _shortMonthsParse = [];
84 for (i = 0; i < 12; i++) {
85 _shortMonthsParse[i] = new RegExp('^' + monthsShort[i] + '$', 'i');
87 return _shortMonthsParse;
89 longMonthsParse : (function (months) {
90 var i, _longMonthsParse = [];
91 for (i = 0; i < 12; i++) {
92 _longMonthsParse[i] = new RegExp('^' + months[i] + '$', 'i');
94 return _longMonthsParse;
96 weekdays : 'neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota'.split('_'),
97 weekdaysShort : 'ne_po_út_st_čt_pá_so'.split('_'),
98 weekdaysMin : 'ne_po_út_st_čt_pá_so'.split('_'),
104 LLL : 'D. MMMM YYYY H:mm',
105 LLLL : 'dddd D. MMMM YYYY H:mm'
108 sameDay: '[dnes v] LT',
109 nextDay: '[zítra v] LT',
110 nextWeek: function () {
111 switch (this.day()) {
113 return '[v neděli v] LT';
116 return '[v] dddd [v] LT';
118 return '[ve středu v] LT';
120 return '[ve čtvrtek v] LT';
122 return '[v pátek v] LT';
124 return '[v sobotu v] LT';
127 lastDay: '[včera v] LT',
128 lastWeek: function () {
129 switch (this.day()) {
131 return '[minulou neděli v] LT';
134 return '[minulé] dddd [v] LT';
136 return '[minulou středu v] LT';
139 return '[minulý] dddd [v] LT';
141 return '[minulou sobotu v] LT';
161 ordinalParse : /\d{1,2}\./,
164 dow : 1, // Monday is the first day of the week.
165 doy : 4 // The week that contains Jan 4th is the first week of the year.