bs.js 4.6 KB

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