You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

138 lines
4.6 KiB

  1. //! moment.js locale configuration
  2. //! locale : hrvatski (hr)
  3. //! author : Bojan Marković : https://github.com/bmarkovic
  4. (function (global, factory) {
  5. typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :
  6. typeof define === 'function' && define.amd ? define(['moment'], factory) :
  7. factory(global.moment)
  8. }(this, function (moment) { 'use strict';
  9. function translate(number, withoutSuffix, key) {
  10. var result = number + ' ';
  11. switch (key) {
  12. case 'm':
  13. return withoutSuffix ? 'jedna minuta' : 'jedne minute';
  14. case 'mm':
  15. if (number === 1) {
  16. result += 'minuta';
  17. } else if (number === 2 || number === 3 || number === 4) {
  18. result += 'minute';
  19. } else {
  20. result += 'minuta';
  21. }
  22. return result;
  23. case 'h':
  24. return withoutSuffix ? 'jedan sat' : 'jednog sata';
  25. case 'hh':
  26. if (number === 1) {
  27. result += 'sat';
  28. } else if (number === 2 || number === 3 || number === 4) {
  29. result += 'sata';
  30. } else {
  31. result += 'sati';
  32. }
  33. return result;
  34. case 'dd':
  35. if (number === 1) {
  36. result += 'dan';
  37. } else {
  38. result += 'dana';
  39. }
  40. return result;
  41. case 'MM':
  42. if (number === 1) {
  43. result += 'mjesec';
  44. } else if (number === 2 || number === 3 || number === 4) {
  45. result += 'mjeseca';
  46. } else {
  47. result += 'mjeseci';
  48. }
  49. return result;
  50. case 'yy':
  51. if (number === 1) {
  52. result += 'godina';
  53. } else if (number === 2 || number === 3 || number === 4) {
  54. result += 'godine';
  55. } else {
  56. result += 'godina';
  57. }
  58. return result;
  59. }
  60. }
  61. var hr = moment.defineLocale('hr', {
  62. months : 'sječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac'.split('_'),
  63. monthsShort : 'sje._vel._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.'.split('_'),
  64. weekdays : 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'),
  65. weekdaysShort : 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
  66. weekdaysMin : 'ne_po_ut_sr_če_pe_su'.split('_'),
  67. longDateFormat : {
  68. LT : 'H:mm',
  69. LTS : 'LT:ss',
  70. L : 'DD. MM. YYYY',
  71. LL : 'D. MMMM YYYY',
  72. LLL : 'D. MMMM YYYY LT',
  73. LLLL : 'dddd, D. MMMM YYYY LT'
  74. },
  75. calendar : {
  76. sameDay : '[danas u] LT',
  77. nextDay : '[sutra u] LT',
  78. nextWeek : function () {
  79. switch (this.day()) {
  80. case 0:
  81. return '[u] [nedjelju] [u] LT';
  82. case 3:
  83. return '[u] [srijedu] [u] LT';
  84. case 6:
  85. return '[u] [subotu] [u] LT';
  86. case 1:
  87. case 2:
  88. case 4:
  89. case 5:
  90. return '[u] dddd [u] LT';
  91. }
  92. },
  93. lastDay : '[jučer u] LT',
  94. lastWeek : function () {
  95. switch (this.day()) {
  96. case 0:
  97. case 3:
  98. return '[prošlu] dddd [u] LT';
  99. case 6:
  100. return '[prošle] [subote] [u] LT';
  101. case 1:
  102. case 2:
  103. case 4:
  104. case 5:
  105. return '[prošli] dddd [u] LT';
  106. }
  107. },
  108. sameElse : 'L'
  109. },
  110. relativeTime : {
  111. future : 'za %s',
  112. past : 'prije %s',
  113. s : 'par sekundi',
  114. m : translate,
  115. mm : translate,
  116. h : translate,
  117. hh : translate,
  118. d : 'dan',
  119. dd : translate,
  120. M : 'mjesec',
  121. MM : translate,
  122. y : 'godinu',
  123. yy : translate
  124. },
  125. ordinalParse: /\d{1,2}\./,
  126. ordinal : '%d.',
  127. week : {
  128. dow : 1, // Monday is the first day of the week.
  129. doy : 7 // The week that contains Jan 1st is the first week of the year.
  130. }
  131. });
  132. return hr;
  133. }));