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.

113 lines
4.3 KiB

  1. //! moment.js locale configuration
  2. //! locale : Lithuanian (lt)
  3. //! author : Mindaugas Mozūras : https://github.com/mmozuras
  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. var units = {
  10. 'm' : 'minutė_minutės_minutę',
  11. 'mm': 'minutės_minučių_minutes',
  12. 'h' : 'valanda_valandos_valandą',
  13. 'hh': 'valandos_valandų_valandas',
  14. 'd' : 'diena_dienos_dieną',
  15. 'dd': 'dienos_dienų_dienas',
  16. 'M' : 'mėnuo_mėnesio_mėnesį',
  17. 'MM': 'mėnesiai_mėnesių_mėnesius',
  18. 'y' : 'metai_metų_metus',
  19. 'yy': 'metai_metų_metus'
  20. },
  21. weekDays = 'sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis'.split('_');
  22. function translateSeconds(number, withoutSuffix, key, isFuture) {
  23. if (withoutSuffix) {
  24. return 'kelios sekundės';
  25. } else {
  26. return isFuture ? 'kelių sekundžių' : 'kelias sekundes';
  27. }
  28. }
  29. function translateSingular(number, withoutSuffix, key, isFuture) {
  30. return withoutSuffix ? forms(key)[0] : (isFuture ? forms(key)[1] : 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 result + translateSingular(number, withoutSuffix, key[0], isFuture);
  42. } else if (withoutSuffix) {
  43. return result + (special(number) ? forms(key)[1] : forms(key)[0]);
  44. } else {
  45. if (isFuture) {
  46. return result + forms(key)[1];
  47. } else {
  48. return result + (special(number) ? forms(key)[1] : forms(key)[2]);
  49. }
  50. }
  51. }
  52. function relativeWeekDay(moment, format) {
  53. var nominative = format.indexOf('dddd HH:mm') === -1,
  54. weekDay = weekDays[moment.day()];
  55. return nominative ? weekDay : weekDay.substring(0, weekDay.length - 2) + 'į';
  56. }
  57. var lt = moment.defineLocale('lt', {
  58. months : 'sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio'.split('_'),
  59. monthsShort : 'sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd'.split('_'),
  60. weekdays : relativeWeekDay,
  61. weekdaysShort : 'Sek_Pir_Ant_Tre_Ket_Pen_Šeš'.split('_'),
  62. weekdaysMin : 'S_P_A_T_K_Pn_Š'.split('_'),
  63. longDateFormat : {
  64. LT : 'HH:mm',
  65. LTS : 'LT:ss',
  66. L : 'YYYY-MM-DD',
  67. LL : 'YYYY [m.] MMMM D [d.]',
  68. LLL : 'YYYY [m.] MMMM D [d.], LT [val.]',
  69. LLLL : 'YYYY [m.] MMMM D [d.], dddd, LT [val.]',
  70. l : 'YYYY-MM-DD',
  71. ll : 'YYYY [m.] MMMM D [d.]',
  72. lll : 'YYYY [m.] MMMM D [d.], LT [val.]',
  73. llll : 'YYYY [m.] MMMM D [d.], ddd, LT [val.]'
  74. },
  75. calendar : {
  76. sameDay : '[Šiandien] LT',
  77. nextDay : '[Rytoj] LT',
  78. nextWeek : 'dddd LT',
  79. lastDay : '[Vakar] LT',
  80. lastWeek : '[Praėjusį] dddd LT',
  81. sameElse : 'L'
  82. },
  83. relativeTime : {
  84. future : 'po %s',
  85. past : 'prieš %s',
  86. s : translateSeconds,
  87. m : translateSingular,
  88. mm : translate,
  89. h : translateSingular,
  90. hh : translate,
  91. d : translateSingular,
  92. dd : translate,
  93. M : translateSingular,
  94. MM : translate,
  95. y : translateSingular,
  96. yy : translate
  97. },
  98. ordinalParse: /\d{1,2}-oji/,
  99. ordinal : function (number) {
  100. return number + '-oji';
  101. },
  102. week : {
  103. dow : 1, // Monday is the first day of the week.
  104. doy : 4 // The week that contains Jan 4th is the first week of the year.
  105. }
  106. });
  107. return lt;
  108. }));