sl.js 5.9 KB

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