bs.js 5.2 KB

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