bs.js 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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. function translate(number, withoutSuffix, key) {
  12. var result = number + ' ';
  13. switch (key) {
  14. case 'm':
  15. return withoutSuffix ? 'jedna minuta' : 'jedne minute';
  16. case 'mm':
  17. if (number === 1) {
  18. result += 'minuta';
  19. } else if (number === 2 || number === 3 || number === 4) {
  20. result += 'minute';
  21. } else {
  22. result += 'minuta';
  23. }
  24. return result;
  25. case 'h':
  26. return withoutSuffix ? 'jedan sat' : 'jednog sata';
  27. case 'hh':
  28. if (number === 1) {
  29. result += 'sat';
  30. } else if (number === 2 || number === 3 || number === 4) {
  31. result += 'sata';
  32. } else {
  33. result += 'sati';
  34. }
  35. return result;
  36. case 'dd':
  37. if (number === 1) {
  38. result += 'dan';
  39. } else {
  40. result += 'dana';
  41. }
  42. return result;
  43. case 'MM':
  44. if (number === 1) {
  45. result += 'mjesec';
  46. } else if (number === 2 || number === 3 || number === 4) {
  47. result += 'mjeseca';
  48. } else {
  49. result += 'mjeseci';
  50. }
  51. return result;
  52. case 'yy':
  53. if (number === 1) {
  54. result += 'godina';
  55. } else if (number === 2 || number === 3 || number === 4) {
  56. result += 'godine';
  57. } else {
  58. result += 'godina';
  59. }
  60. return result;
  61. }
  62. }
  63. var bs = moment.defineLocale('bs', {
  64. months : 'januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar'.split('_'),
  65. monthsShort : 'jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.'.split('_'),
  66. monthsParseExact: true,
  67. weekdays : 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'),
  68. weekdaysShort : 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
  69. weekdaysMin : 'ne_po_ut_sr_če_pe_su'.split('_'),
  70. weekdaysParseExact : true,
  71. longDateFormat : {
  72. LT : 'H:mm',
  73. LTS : 'H:mm:ss',
  74. L : 'DD. MM. YYYY',
  75. LL : 'D. MMMM YYYY',
  76. LLL : 'D. MMMM YYYY H:mm',
  77. LLLL : 'dddd, D. MMMM YYYY H:mm'
  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. ordinalParse: /\d{1,2}\./,
  130. ordinal : '%d.',
  131. week : {
  132. dow : 1, // Monday is the first day of the week.
  133. doy : 7 // The week that contains Jan 1st is the first week of the year.
  134. }
  135. });
  136. return bs;
  137. }));