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.

77 lines
2.9 KiB

  1. //! moment.js locale configuration
  2. //! locale : latvian (lv)
  3. //! author : Kristaps Karlsons : https://github.com/skakri
  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. 'mm': 'minūti_minūtes_minūte_minūtes',
  11. 'hh': 'stundu_stundas_stunda_stundas',
  12. 'dd': 'dienu_dienas_diena_dienas',
  13. 'MM': 'mēnesi_mēnešus_mēnesis_mēneši',
  14. 'yy': 'gadu_gadus_gads_gadi'
  15. };
  16. function format(word, number, withoutSuffix) {
  17. var forms = word.split('_');
  18. if (withoutSuffix) {
  19. return number % 10 === 1 && number !== 11 ? forms[2] : forms[3];
  20. } else {
  21. return number % 10 === 1 && number !== 11 ? forms[0] : forms[1];
  22. }
  23. }
  24. function relativeTimeWithPlural(number, withoutSuffix, key) {
  25. return number + ' ' + format(units[key], number, withoutSuffix);
  26. }
  27. var lv = moment.defineLocale('lv', {
  28. months : 'janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris'.split('_'),
  29. monthsShort : 'jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec'.split('_'),
  30. weekdays : 'svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena'.split('_'),
  31. weekdaysShort : 'Sv_P_O_T_C_Pk_S'.split('_'),
  32. weekdaysMin : 'Sv_P_O_T_C_Pk_S'.split('_'),
  33. longDateFormat : {
  34. LT : 'HH:mm',
  35. LTS : 'LT:ss',
  36. L : 'DD.MM.YYYY',
  37. LL : 'YYYY. [gada] D. MMMM',
  38. LLL : 'YYYY. [gada] D. MMMM, LT',
  39. LLLL : 'YYYY. [gada] D. MMMM, dddd, LT'
  40. },
  41. calendar : {
  42. sameDay : '[Šodien pulksten] LT',
  43. nextDay : '[Rīt pulksten] LT',
  44. nextWeek : 'dddd [pulksten] LT',
  45. lastDay : '[Vakar pulksten] LT',
  46. lastWeek : '[Pagājušā] dddd [pulksten] LT',
  47. sameElse : 'L'
  48. },
  49. relativeTime : {
  50. future : '%s vēlāk',
  51. past : '%s agrāk',
  52. s : 'dažas sekundes',
  53. m : 'minūti',
  54. mm : relativeTimeWithPlural,
  55. h : 'stundu',
  56. hh : relativeTimeWithPlural,
  57. d : 'dienu',
  58. dd : relativeTimeWithPlural,
  59. M : 'mēnesi',
  60. MM : relativeTimeWithPlural,
  61. y : 'gadu',
  62. yy : relativeTimeWithPlural
  63. },
  64. ordinalParse: /\d{1,2}\./,
  65. ordinal : '%d.',
  66. week : {
  67. dow : 1, // Monday is the first day of the week.
  68. doy : 4 // The week that contains Jan 4th is the first week of the year.
  69. }
  70. });
  71. return lv;
  72. }));