Node-Red configuration
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

sl.js 6.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. //! moment.js locale configuration
  2. //! locale : Slovenian [sl]
  3. //! author : Robert Sedovšek : https://github.com/sedovsek
  4. ;(function (global, factory) {
  5. typeof exports === 'object' && typeof module !== 'undefined'
  6. && typeof require === 'function' ? factory(require('../moment')) :
  7. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  8. factory(global.moment)
  9. }(this, (function (moment) { 'use strict';
  10. //! moment.js locale configuration
  11. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  12. var result = number + ' ';
  13. switch (key) {
  14. case 's':
  15. return withoutSuffix || isFuture
  16. ? 'nekaj sekund'
  17. : 'nekaj sekundami';
  18. case 'ss':
  19. if (number === 1) {
  20. result += withoutSuffix ? 'sekundo' : 'sekundi';
  21. } else if (number === 2) {
  22. result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';
  23. } else if (number < 5) {
  24. result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';
  25. } else {
  26. result += 'sekund';
  27. }
  28. return result;
  29. case 'm':
  30. return withoutSuffix ? 'ena minuta' : 'eno minuto';
  31. case 'mm':
  32. if (number === 1) {
  33. result += withoutSuffix ? 'minuta' : 'minuto';
  34. } else if (number === 2) {
  35. result += withoutSuffix || isFuture ? 'minuti' : 'minutama';
  36. } else if (number < 5) {
  37. result += withoutSuffix || isFuture ? 'minute' : 'minutami';
  38. } else {
  39. result += withoutSuffix || isFuture ? 'minut' : 'minutami';
  40. }
  41. return result;
  42. case 'h':
  43. return withoutSuffix ? 'ena ura' : 'eno uro';
  44. case 'hh':
  45. if (number === 1) {
  46. result += withoutSuffix ? 'ura' : 'uro';
  47. } else if (number === 2) {
  48. result += withoutSuffix || isFuture ? 'uri' : 'urama';
  49. } else if (number < 5) {
  50. result += withoutSuffix || isFuture ? 'ure' : 'urami';
  51. } else {
  52. result += withoutSuffix || isFuture ? 'ur' : 'urami';
  53. }
  54. return result;
  55. case 'd':
  56. return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';
  57. case 'dd':
  58. if (number === 1) {
  59. result += withoutSuffix || isFuture ? 'dan' : 'dnem';
  60. } else if (number === 2) {
  61. result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';
  62. } else {
  63. result += withoutSuffix || isFuture ? 'dni' : 'dnevi';
  64. }
  65. return result;
  66. case 'M':
  67. return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';
  68. case 'MM':
  69. if (number === 1) {
  70. result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';
  71. } else if (number === 2) {
  72. result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';
  73. } else if (number < 5) {
  74. result += withoutSuffix || isFuture ? 'mesece' : 'meseci';
  75. } else {
  76. result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';
  77. }
  78. return result;
  79. case 'y':
  80. return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';
  81. case 'yy':
  82. if (number === 1) {
  83. result += withoutSuffix || isFuture ? 'leto' : 'letom';
  84. } else if (number === 2) {
  85. result += withoutSuffix || isFuture ? 'leti' : 'letoma';
  86. } else if (number < 5) {
  87. result += withoutSuffix || isFuture ? 'leta' : 'leti';
  88. } else {
  89. result += withoutSuffix || isFuture ? 'let' : 'leti';
  90. }
  91. return result;
  92. }
  93. }
  94. var sl = moment.defineLocale('sl', {
  95. months: 'januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december'.split(
  96. '_'
  97. ),
  98. monthsShort:
  99. 'jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.'.split(
  100. '_'
  101. ),
  102. monthsParseExact: true,
  103. weekdays: 'nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota'.split('_'),
  104. weekdaysShort: 'ned._pon._tor._sre._čet._pet._sob.'.split('_'),
  105. weekdaysMin: 'ne_po_to_sr_če_pe_so'.split('_'),
  106. weekdaysParseExact: true,
  107. longDateFormat: {
  108. LT: 'H:mm',
  109. LTS: 'H:mm:ss',
  110. L: 'DD. MM. YYYY',
  111. LL: 'D. MMMM YYYY',
  112. LLL: 'D. MMMM YYYY H:mm',
  113. LLLL: 'dddd, D. MMMM YYYY H:mm',
  114. },
  115. calendar: {
  116. sameDay: '[danes ob] LT',
  117. nextDay: '[jutri ob] LT',
  118. nextWeek: function () {
  119. switch (this.day()) {
  120. case 0:
  121. return '[v] [nedeljo] [ob] LT';
  122. case 3:
  123. return '[v] [sredo] [ob] LT';
  124. case 6:
  125. return '[v] [soboto] [ob] LT';
  126. case 1:
  127. case 2:
  128. case 4:
  129. case 5:
  130. return '[v] dddd [ob] LT';
  131. }
  132. },
  133. lastDay: '[včeraj ob] LT',
  134. lastWeek: function () {
  135. switch (this.day()) {
  136. case 0:
  137. return '[prejšnjo] [nedeljo] [ob] LT';
  138. case 3:
  139. return '[prejšnjo] [sredo] [ob] LT';
  140. case 6:
  141. return '[prejšnjo] [soboto] [ob] LT';
  142. case 1:
  143. case 2:
  144. case 4:
  145. case 5:
  146. return '[prejšnji] dddd [ob] LT';
  147. }
  148. },
  149. sameElse: 'L',
  150. },
  151. relativeTime: {
  152. future: 'čez %s',
  153. past: 'pred %s',
  154. s: processRelativeTime,
  155. ss: processRelativeTime,
  156. m: processRelativeTime,
  157. mm: processRelativeTime,
  158. h: processRelativeTime,
  159. hh: processRelativeTime,
  160. d: processRelativeTime,
  161. dd: processRelativeTime,
  162. M: processRelativeTime,
  163. MM: processRelativeTime,
  164. y: processRelativeTime,
  165. yy: processRelativeTime,
  166. },
  167. dayOfMonthOrdinalParse: /\d{1,2}\./,
  168. ordinal: '%d.',
  169. week: {
  170. dow: 1, // Monday is the first day of the week.
  171. doy: 7, // The week that contains Jan 7th is the first week of the year.
  172. },
  173. });
  174. return sl;
  175. })));