Node-Red configuration
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

sk.js 5.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. //! moment.js locale configuration
  2. //! locale : Slovak [sk]
  3. //! author : Martin Minka : https://github.com/k2s
  4. //! based on work of petrbela : https://github.com/petrbela
  5. ;(function (global, factory) {
  6. typeof exports === 'object' && typeof module !== 'undefined'
  7. && typeof require === 'function' ? factory(require('../moment')) :
  8. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  9. factory(global.moment)
  10. }(this, (function (moment) { 'use strict';
  11. //! moment.js locale configuration
  12. var months =
  13. 'január_február_marec_apríl_máj_jún_júl_august_september_október_november_december'.split(
  14. '_'
  15. ),
  16. monthsShort = 'jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec'.split('_');
  17. function plural(n) {
  18. return n > 1 && n < 5;
  19. }
  20. function translate(number, withoutSuffix, key, isFuture) {
  21. var result = number + ' ';
  22. switch (key) {
  23. case 's': // a few seconds / in a few seconds / a few seconds ago
  24. return withoutSuffix || isFuture ? 'pár sekúnd' : 'pár sekundami';
  25. case 'ss': // 9 seconds / in 9 seconds / 9 seconds ago
  26. if (withoutSuffix || isFuture) {
  27. return result + (plural(number) ? 'sekundy' : 'sekúnd');
  28. } else {
  29. return result + 'sekundami';
  30. }
  31. case 'm': // a minute / in a minute / a minute ago
  32. return withoutSuffix ? 'minúta' : isFuture ? 'minútu' : 'minútou';
  33. case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago
  34. if (withoutSuffix || isFuture) {
  35. return result + (plural(number) ? 'minúty' : 'minút');
  36. } else {
  37. return result + 'minútami';
  38. }
  39. case 'h': // an hour / in an hour / an hour ago
  40. return withoutSuffix ? 'hodina' : isFuture ? 'hodinu' : 'hodinou';
  41. case 'hh': // 9 hours / in 9 hours / 9 hours ago
  42. if (withoutSuffix || isFuture) {
  43. return result + (plural(number) ? 'hodiny' : 'hodín');
  44. } else {
  45. return result + 'hodinami';
  46. }
  47. case 'd': // a day / in a day / a day ago
  48. return withoutSuffix || isFuture ? 'deň' : 'dňom';
  49. case 'dd': // 9 days / in 9 days / 9 days ago
  50. if (withoutSuffix || isFuture) {
  51. return result + (plural(number) ? 'dni' : 'dní');
  52. } else {
  53. return result + 'dňami';
  54. }
  55. case 'M': // a month / in a month / a month ago
  56. return withoutSuffix || isFuture ? 'mesiac' : 'mesiacom';
  57. case 'MM': // 9 months / in 9 months / 9 months ago
  58. if (withoutSuffix || isFuture) {
  59. return result + (plural(number) ? 'mesiace' : 'mesiacov');
  60. } else {
  61. return result + 'mesiacmi';
  62. }
  63. case 'y': // a year / in a year / a year ago
  64. return withoutSuffix || isFuture ? 'rok' : 'rokom';
  65. case 'yy': // 9 years / in 9 years / 9 years ago
  66. if (withoutSuffix || isFuture) {
  67. return result + (plural(number) ? 'roky' : 'rokov');
  68. } else {
  69. return result + 'rokmi';
  70. }
  71. }
  72. }
  73. var sk = moment.defineLocale('sk', {
  74. months: months,
  75. monthsShort: monthsShort,
  76. weekdays: 'nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota'.split('_'),
  77. weekdaysShort: 'ne_po_ut_st_št_pi_so'.split('_'),
  78. weekdaysMin: 'ne_po_ut_st_št_pi_so'.split('_'),
  79. longDateFormat: {
  80. LT: 'H:mm',
  81. LTS: 'H:mm:ss',
  82. L: 'DD.MM.YYYY',
  83. LL: 'D. MMMM YYYY',
  84. LLL: 'D. MMMM YYYY H:mm',
  85. LLLL: 'dddd D. MMMM YYYY H:mm',
  86. },
  87. calendar: {
  88. sameDay: '[dnes o] LT',
  89. nextDay: '[zajtra o] LT',
  90. nextWeek: function () {
  91. switch (this.day()) {
  92. case 0:
  93. return '[v nedeľu o] LT';
  94. case 1:
  95. case 2:
  96. return '[v] dddd [o] LT';
  97. case 3:
  98. return '[v stredu o] LT';
  99. case 4:
  100. return '[vo štvrtok o] LT';
  101. case 5:
  102. return '[v piatok o] LT';
  103. case 6:
  104. return '[v sobotu o] LT';
  105. }
  106. },
  107. lastDay: '[včera o] LT',
  108. lastWeek: function () {
  109. switch (this.day()) {
  110. case 0:
  111. return '[minulú nedeľu o] LT';
  112. case 1:
  113. case 2:
  114. return '[minulý] dddd [o] LT';
  115. case 3:
  116. return '[minulú stredu o] LT';
  117. case 4:
  118. case 5:
  119. return '[minulý] dddd [o] LT';
  120. case 6:
  121. return '[minulú sobotu o] LT';
  122. }
  123. },
  124. sameElse: 'L',
  125. },
  126. relativeTime: {
  127. future: 'za %s',
  128. past: 'pred %s',
  129. s: translate,
  130. ss: translate,
  131. m: translate,
  132. mm: translate,
  133. h: translate,
  134. hh: translate,
  135. d: translate,
  136. dd: translate,
  137. M: translate,
  138. MM: translate,
  139. y: translate,
  140. yy: translate,
  141. },
  142. dayOfMonthOrdinalParse: /\d{1,2}\./,
  143. ordinal: '%d.',
  144. week: {
  145. dow: 1, // Monday is the first day of the week.
  146. doy: 4, // The week that contains Jan 4th is the first week of the year.
  147. },
  148. });
  149. return sk;
  150. })));