sl.js 6.8 KB

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