Node-Red configuration
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.

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:
  72. 'jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.'.split(
  73. '_'
  74. ),
  75. monthsParseExact: true,
  76. weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split(
  77. '_'
  78. ),
  79. weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
  80. weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
  81. weekdaysParseExact: true,
  82. longDateFormat: {
  83. LT: 'H:mm',
  84. LTS: 'H:mm:ss',
  85. L: 'DD.MM.YYYY',
  86. LL: 'D. MMMM YYYY',
  87. LLL: 'D. MMMM YYYY H:mm',
  88. LLLL: 'dddd, D. MMMM YYYY H:mm',
  89. },
  90. calendar: {
  91. sameDay: '[danas u] LT',
  92. nextDay: '[sutra u] LT',
  93. nextWeek: function () {
  94. switch (this.day()) {
  95. case 0:
  96. return '[u] [nedjelju] [u] LT';
  97. case 3:
  98. return '[u] [srijedu] [u] LT';
  99. case 6:
  100. return '[u] [subotu] [u] LT';
  101. case 1:
  102. case 2:
  103. case 4:
  104. case 5:
  105. return '[u] dddd [u] LT';
  106. }
  107. },
  108. lastDay: '[jučer u] LT',
  109. lastWeek: function () {
  110. switch (this.day()) {
  111. case 0:
  112. case 3:
  113. return '[prošlu] dddd [u] LT';
  114. case 6:
  115. return '[prošle] [subote] [u] LT';
  116. case 1:
  117. case 2:
  118. case 4:
  119. case 5:
  120. return '[prošli] dddd [u] LT';
  121. }
  122. },
  123. sameElse: 'L',
  124. },
  125. relativeTime: {
  126. future: 'za %s',
  127. past: 'prije %s',
  128. s: 'par sekundi',
  129. ss: translate,
  130. m: translate,
  131. mm: translate,
  132. h: translate,
  133. hh: translate,
  134. d: 'dan',
  135. dd: translate,
  136. M: 'mjesec',
  137. MM: translate,
  138. y: 'godinu',
  139. yy: translate,
  140. },
  141. dayOfMonthOrdinalParse: /\d{1,2}\./,
  142. ordinal: '%d.',
  143. week: {
  144. dow: 1, // Monday is the first day of the week.
  145. doy: 7, // The week that contains Jan 7th is the first week of the year.
  146. },
  147. });