Node-Red configuration
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.

lt.js 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. //! moment.js locale configuration
  2. //! locale : Lithuanian [lt]
  3. //! author : Mindaugas Mozūras : https://github.com/mmozuras
  4. import moment from '../moment';
  5. var units = {
  6. ss: 'sekundė_sekundžių_sekundes',
  7. m: 'minutė_minutės_minutę',
  8. mm: 'minutės_minučių_minutes',
  9. h: 'valanda_valandos_valandą',
  10. hh: 'valandos_valandų_valandas',
  11. d: 'diena_dienos_dieną',
  12. dd: 'dienos_dienų_dienas',
  13. M: 'mėnuo_mėnesio_mėnesį',
  14. MM: 'mėnesiai_mėnesių_mėnesius',
  15. y: 'metai_metų_metus',
  16. yy: 'metai_metų_metus',
  17. };
  18. function translateSeconds(number, withoutSuffix, key, isFuture) {
  19. if (withoutSuffix) {
  20. return 'kelios sekundės';
  21. } else {
  22. return isFuture ? 'kelių sekundžių' : 'kelias sekundes';
  23. }
  24. }
  25. function translateSingular(number, withoutSuffix, key, isFuture) {
  26. return withoutSuffix
  27. ? forms(key)[0]
  28. : isFuture
  29. ? forms(key)[1]
  30. : forms(key)[2];
  31. }
  32. function special(number) {
  33. return number % 10 === 0 || (number > 10 && number < 20);
  34. }
  35. function forms(key) {
  36. return units[key].split('_');
  37. }
  38. function translate(number, withoutSuffix, key, isFuture) {
  39. var result = number + ' ';
  40. if (number === 1) {
  41. return (
  42. result + translateSingular(number, withoutSuffix, key[0], isFuture)
  43. );
  44. } else if (withoutSuffix) {
  45. return result + (special(number) ? forms(key)[1] : forms(key)[0]);
  46. } else {
  47. if (isFuture) {
  48. return result + forms(key)[1];
  49. } else {
  50. return result + (special(number) ? forms(key)[1] : forms(key)[2]);
  51. }
  52. }
  53. }
  54. export default moment.defineLocale('lt', {
  55. months: {
  56. format: 'sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio'.split(
  57. '_'
  58. ),
  59. standalone:
  60. 'sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis'.split(
  61. '_'
  62. ),
  63. isFormat: /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/,
  64. },
  65. monthsShort: 'sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd'.split('_'),
  66. weekdays: {
  67. format: 'sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį'.split(
  68. '_'
  69. ),
  70. standalone:
  71. 'sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis'.split(
  72. '_'
  73. ),
  74. isFormat: /dddd HH:mm/,
  75. },
  76. weekdaysShort: 'Sek_Pir_Ant_Tre_Ket_Pen_Šeš'.split('_'),
  77. weekdaysMin: 'S_P_A_T_K_Pn_Š'.split('_'),
  78. weekdaysParseExact: true,
  79. longDateFormat: {
  80. LT: 'HH:mm',
  81. LTS: 'HH:mm:ss',
  82. L: 'YYYY-MM-DD',
  83. LL: 'YYYY [m.] MMMM D [d.]',
  84. LLL: 'YYYY [m.] MMMM D [d.], HH:mm [val.]',
  85. LLLL: 'YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]',
  86. l: 'YYYY-MM-DD',
  87. ll: 'YYYY [m.] MMMM D [d.]',
  88. lll: 'YYYY [m.] MMMM D [d.], HH:mm [val.]',
  89. llll: 'YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]',
  90. },
  91. calendar: {
  92. sameDay: '[Šiandien] LT',
  93. nextDay: '[Rytoj] LT',
  94. nextWeek: 'dddd LT',
  95. lastDay: '[Vakar] LT',
  96. lastWeek: '[Praėjusį] dddd LT',
  97. sameElse: 'L',
  98. },
  99. relativeTime: {
  100. future: 'po %s',
  101. past: 'prieš %s',
  102. s: translateSeconds,
  103. ss: translate,
  104. m: translateSingular,
  105. mm: translate,
  106. h: translateSingular,
  107. hh: translate,
  108. d: translateSingular,
  109. dd: translate,
  110. M: translateSingular,
  111. MM: translate,
  112. y: translateSingular,
  113. yy: translate,
  114. },
  115. dayOfMonthOrdinalParse: /\d{1,2}-oji/,
  116. ordinal: function (number) {
  117. return number + '-oji';
  118. },
  119. week: {
  120. dow: 1, // Monday is the first day of the week.
  121. doy: 4, // The week that contains Jan 4th is the first week of the year.
  122. },
  123. });