Node-Red configuration
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

sr.js 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. //! moment.js locale configuration
  2. //! locale : Serbian [sr]
  3. //! author : Milan Janačković<milanjanackovic@gmail.com> : https://github.com/milan-j
  4. //! author : Stefan Crnjaković <stefan@hotmail.rs> : https://github.com/crnjakovic
  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. var translator = {
  13. words: {
  14. //Different grammatical cases
  15. ss: ['sekunda', 'sekunde', 'sekundi'],
  16. m: ['jedan minut', 'jednog minuta'],
  17. mm: ['minut', 'minuta', 'minuta'],
  18. h: ['jedan sat', 'jednog sata'],
  19. hh: ['sat', 'sata', 'sati'],
  20. d: ['jedan dan', 'jednog dana'],
  21. dd: ['dan', 'dana', 'dana'],
  22. M: ['jedan mesec', 'jednog meseca'],
  23. MM: ['mesec', 'meseca', 'meseci'],
  24. y: ['jednu godinu', 'jedne godine'],
  25. yy: ['godinu', 'godine', 'godina'],
  26. },
  27. correctGrammaticalCase: function (number, wordKey) {
  28. if (
  29. number % 10 >= 1 &&
  30. number % 10 <= 4 &&
  31. (number % 100 < 10 || number % 100 >= 20)
  32. ) {
  33. return number % 10 === 1 ? wordKey[0] : wordKey[1];
  34. }
  35. return wordKey[2];
  36. },
  37. translate: function (number, withoutSuffix, key, isFuture) {
  38. var wordKey = translator.words[key],
  39. word;
  40. if (key.length === 1) {
  41. // Nominativ
  42. if (key === 'y' && withoutSuffix) return 'jedna godina';
  43. return isFuture || withoutSuffix ? wordKey[0] : wordKey[1];
  44. }
  45. word = translator.correctGrammaticalCase(number, wordKey);
  46. // Nominativ
  47. if (key === 'yy' && withoutSuffix && word === 'godinu') {
  48. return number + ' godina';
  49. }
  50. return number + ' ' + word;
  51. },
  52. };
  53. var sr = moment.defineLocale('sr', {
  54. months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split(
  55. '_'
  56. ),
  57. monthsShort:
  58. 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split('_'),
  59. monthsParseExact: true,
  60. weekdays: 'nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota'.split(
  61. '_'
  62. ),
  63. weekdaysShort: 'ned._pon._uto._sre._čet._pet._sub.'.split('_'),
  64. weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
  65. weekdaysParseExact: true,
  66. longDateFormat: {
  67. LT: 'H:mm',
  68. LTS: 'H:mm:ss',
  69. L: 'D. M. YYYY.',
  70. LL: 'D. MMMM YYYY.',
  71. LLL: 'D. MMMM YYYY. H:mm',
  72. LLLL: 'dddd, D. MMMM YYYY. H:mm',
  73. },
  74. calendar: {
  75. sameDay: '[danas u] LT',
  76. nextDay: '[sutra u] LT',
  77. nextWeek: function () {
  78. switch (this.day()) {
  79. case 0:
  80. return '[u] [nedelju] [u] LT';
  81. case 3:
  82. return '[u] [sredu] [u] LT';
  83. case 6:
  84. return '[u] [subotu] [u] LT';
  85. case 1:
  86. case 2:
  87. case 4:
  88. case 5:
  89. return '[u] dddd [u] LT';
  90. }
  91. },
  92. lastDay: '[juče u] LT',
  93. lastWeek: function () {
  94. var lastWeekDays = [
  95. '[prošle] [nedelje] [u] LT',
  96. '[prošlog] [ponedeljka] [u] LT',
  97. '[prošlog] [utorka] [u] LT',
  98. '[prošle] [srede] [u] LT',
  99. '[prošlog] [četvrtka] [u] LT',
  100. '[prošlog] [petka] [u] LT',
  101. '[prošle] [subote] [u] LT',
  102. ];
  103. return lastWeekDays[this.day()];
  104. },
  105. sameElse: 'L',
  106. },
  107. relativeTime: {
  108. future: 'za %s',
  109. past: 'pre %s',
  110. s: 'nekoliko sekundi',
  111. ss: translator.translate,
  112. m: translator.translate,
  113. mm: translator.translate,
  114. h: translator.translate,
  115. hh: translator.translate,
  116. d: translator.translate,
  117. dd: translator.translate,
  118. M: translator.translate,
  119. MM: translator.translate,
  120. y: translator.translate,
  121. yy: translator.translate,
  122. },
  123. dayOfMonthOrdinalParse: /\d{1,2}\./,
  124. ordinal: '%d.',
  125. week: {
  126. dow: 1, // Monday is the first day of the week.
  127. doy: 7, // The week that contains Jan 7th is the first week of the year.
  128. },
  129. });
  130. return sr;
  131. })));