bs.js 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. // moment.js language configuration
  2. // language : 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(window.moment); // Browser 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.lang('bs', {
  67. months : "januar_februar_mart_april_maj_juni_juli_avgust_septembar_oktobar_novembar_decembar".split("_"),
  68. monthsShort : "jan._feb._mar._apr._maj._jun._jul._avg._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. L : "DD. MM. YYYY",
  75. LL : "D. MMMM YYYY",
  76. LLL : "D. MMMM YYYY LT",
  77. LLLL : "dddd, D. MMMM YYYY LT"
  78. },
  79. calendar : {
  80. sameDay : '[danas u] LT',
  81. nextDay : '[sutra u] LT',
  82. nextWeek : function () {
  83. switch (this.day()) {
  84. case 0:
  85. return '[u] [nedjelju] [u] LT';
  86. case 3:
  87. return '[u] [srijedu] [u] LT';
  88. case 6:
  89. return '[u] [subotu] [u] LT';
  90. case 1:
  91. case 2:
  92. case 4:
  93. case 5:
  94. return '[u] dddd [u] LT';
  95. }
  96. },
  97. lastDay : '[jučer u] LT',
  98. lastWeek : function () {
  99. switch (this.day()) {
  100. case 0:
  101. case 3:
  102. return '[prošlu] dddd [u] LT';
  103. case 6:
  104. return '[prošle] [subote] [u] LT';
  105. case 1:
  106. case 2:
  107. case 4:
  108. case 5:
  109. return '[prošli] dddd [u] LT';
  110. }
  111. },
  112. sameElse : 'L'
  113. },
  114. relativeTime : {
  115. future : "za %s",
  116. past : "prije %s",
  117. s : "par sekundi",
  118. m : translate,
  119. mm : translate,
  120. h : translate,
  121. hh : translate,
  122. d : "dan",
  123. dd : translate,
  124. M : "mjesec",
  125. MM : translate,
  126. y : "godinu",
  127. yy : translate
  128. },
  129. ordinal : '%d.',
  130. week : {
  131. dow : 1, // Monday is the first day of the week.
  132. doy : 7 // The week that contains Jan 1st is the first week of the year.
  133. }
  134. });
  135. }));