cs.js 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. // moment.js language configuration
  2. // language : czech (cs)
  3. // author : petrbela : https://github.com/petrbela
  4. (function (factory) {
  5. if (typeof define === 'function' && define.amd) {
  6. define(['moment'], factory); // AMD
  7. } else if (typeof exports === 'object') {
  8. module.exports = factory(require('../moment')); // Node
  9. } else {
  10. factory(window.moment); // Browser global
  11. }
  12. }(function (moment) {
  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("_");
  15. function plural(n) {
  16. return (n > 1) && (n < 5) && (~~(n / 10) !== 1);
  17. }
  18. function translate(number, withoutSuffix, key, isFuture) {
  19. var result = number + " ";
  20. switch (key) {
  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');
  28. } else {
  29. return result + 'minutami';
  30. }
  31. break;
  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');
  37. } else {
  38. return result + 'hodinami';
  39. }
  40. break;
  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í');
  46. } else {
  47. return result + 'dny';
  48. }
  49. break;
  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ů');
  55. } else {
  56. return result + 'měsíci';
  57. }
  58. break;
  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');
  64. } else {
  65. return result + 'lety';
  66. }
  67. break;
  68. }
  69. }
  70. return moment.lang('cs', {
  71. months : months,
  72. monthsShort : monthsShort,
  73. monthsParse : (function (months, monthsShort) {
  74. var i, _monthsParse = [];
  75. for (i = 0; i < 12; i++) {
  76. // use custom parser to solve problem with July (červenec)
  77. _monthsParse[i] = new RegExp('^' + months[i] + '$|^' + monthsShort[i] + '$', 'i');
  78. }
  79. return _monthsParse;
  80. }(months, monthsShort)),
  81. weekdays : "neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),
  82. weekdaysShort : "ne_po_út_st_čt_pá_so".split("_"),
  83. weekdaysMin : "ne_po_út_st_čt_pá_so".split("_"),
  84. longDateFormat : {
  85. LT: "H.mm",
  86. L : "DD. MM. YYYY",
  87. LL : "D. MMMM YYYY",
  88. LLL : "D. MMMM YYYY LT",
  89. LLLL : "dddd D. MMMM YYYY LT"
  90. },
  91. calendar : {
  92. sameDay: "[dnes v] LT",
  93. nextDay: '[zítra v] LT',
  94. nextWeek: function () {
  95. switch (this.day()) {
  96. case 0:
  97. return '[v neděli v] LT';
  98. case 1:
  99. case 2:
  100. return '[v] dddd [v] LT';
  101. case 3:
  102. return '[ve středu v] LT';
  103. case 4:
  104. return '[ve čtvrtek v] LT';
  105. case 5:
  106. return '[v pátek v] LT';
  107. case 6:
  108. return '[v sobotu v] LT';
  109. }
  110. },
  111. lastDay: '[včera v] LT',
  112. lastWeek: function () {
  113. switch (this.day()) {
  114. case 0:
  115. return '[minulou neděli v] LT';
  116. case 1:
  117. case 2:
  118. return '[minulé] dddd [v] LT';
  119. case 3:
  120. return '[minulou středu v] LT';
  121. case 4:
  122. case 5:
  123. return '[minulý] dddd [v] LT';
  124. case 6:
  125. return '[minulou sobotu v] LT';
  126. }
  127. },
  128. sameElse: "L"
  129. },
  130. relativeTime : {
  131. future : "za %s",
  132. past : "před %s",
  133. s : 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. ordinal : '%d.',
  146. week : {
  147. dow : 1, // Monday is the first day of the week.
  148. doy : 4 // The week that contains Jan 4th is the first week of the year.
  149. }
  150. });
  151. }));