sl.js 4.7 KB

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