You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

139 lines
4.6 KiB

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