bs.js 5.5 KB

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