bs.js 4.4KB

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