You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

145 lines
4.7 KiB

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