Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

182 строки
6.9KB

  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: 'jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.'.split(
  99. '_'
  100. ),
  101. monthsParseExact: true,
  102. weekdays: 'nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota'.split('_'),
  103. weekdaysShort: 'ned._pon._tor._sre._čet._pet._sob.'.split('_'),
  104. weekdaysMin: 'ne_po_to_sr_če_pe_so'.split('_'),
  105. weekdaysParseExact: true,
  106. longDateFormat: {
  107. LT: 'H:mm',
  108. LTS: 'H:mm:ss',
  109. L: 'DD. MM. YYYY',
  110. LL: 'D. MMMM YYYY',
  111. LLL: 'D. MMMM YYYY H:mm',
  112. LLLL: 'dddd, D. MMMM YYYY H:mm',
  113. },
  114. calendar: {
  115. sameDay: '[danes ob] LT',
  116. nextDay: '[jutri ob] LT',
  117. nextWeek: function () {
  118. switch (this.day()) {
  119. case 0:
  120. return '[v] [nedeljo] [ob] LT';
  121. case 3:
  122. return '[v] [sredo] [ob] LT';
  123. case 6:
  124. return '[v] [soboto] [ob] LT';
  125. case 1:
  126. case 2:
  127. case 4:
  128. case 5:
  129. return '[v] dddd [ob] LT';
  130. }
  131. },
  132. lastDay: '[včeraj ob] LT',
  133. lastWeek: function () {
  134. switch (this.day()) {
  135. case 0:
  136. return '[prejšnjo] [nedeljo] [ob] LT';
  137. case 3:
  138. return '[prejšnjo] [sredo] [ob] LT';
  139. case 6:
  140. return '[prejšnjo] [soboto] [ob] LT';
  141. case 1:
  142. case 2:
  143. case 4:
  144. case 5:
  145. return '[prejšnji] dddd [ob] LT';
  146. }
  147. },
  148. sameElse: 'L',
  149. },
  150. relativeTime: {
  151. future: 'čez %s',
  152. past: 'pred %s',
  153. s: processRelativeTime,
  154. ss: processRelativeTime,
  155. m: processRelativeTime,
  156. mm: processRelativeTime,
  157. h: processRelativeTime,
  158. hh: processRelativeTime,
  159. d: processRelativeTime,
  160. dd: processRelativeTime,
  161. M: processRelativeTime,
  162. MM: processRelativeTime,
  163. y: processRelativeTime,
  164. yy: processRelativeTime,
  165. },
  166. dayOfMonthOrdinalParse: /\d{1,2}\./,
  167. ordinal: '%d.',
  168. week: {
  169. dow: 1, // Monday is the first day of the week.
  170. doy: 7, // The week that contains Jan 7th is the first week of the year.
  171. },
  172. });
  173. return sl;
  174. })));