ca.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. //! moment.js locale configuration
  2. //! locale : Catalan [ca]
  3. //! author : Juan G. Hurtado : https://github.com/juanghurtado
  4. import moment from '../moment';
  5. export default moment.defineLocale('ca', {
  6. months: {
  7. standalone:
  8. 'gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre'.split(
  9. '_'
  10. ),
  11. format: "de gener_de febrer_de març_d'abril_de maig_de juny_de juliol_d'agost_de setembre_d'octubre_de novembre_de desembre".split(
  12. '_'
  13. ),
  14. isFormat: /D[oD]?(\s)+MMMM/,
  15. },
  16. monthsShort:
  17. 'gen._febr._març_abr._maig_juny_jul._ag._set._oct._nov._des.'.split(
  18. '_'
  19. ),
  20. monthsParseExact: true,
  21. weekdays:
  22. 'diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte'.split(
  23. '_'
  24. ),
  25. weekdaysShort: 'dg._dl._dt._dc._dj._dv._ds.'.split('_'),
  26. weekdaysMin: 'dg_dl_dt_dc_dj_dv_ds'.split('_'),
  27. weekdaysParseExact: true,
  28. longDateFormat: {
  29. LT: 'H:mm',
  30. LTS: 'H:mm:ss',
  31. L: 'DD/MM/YYYY',
  32. LL: 'D MMMM [de] YYYY',
  33. ll: 'D MMM YYYY',
  34. LLL: 'D MMMM [de] YYYY [a les] H:mm',
  35. lll: 'D MMM YYYY, H:mm',
  36. LLLL: 'dddd D MMMM [de] YYYY [a les] H:mm',
  37. llll: 'ddd D MMM YYYY, H:mm',
  38. },
  39. calendar: {
  40. sameDay: function () {
  41. return '[avui a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT';
  42. },
  43. nextDay: function () {
  44. return '[demà a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT';
  45. },
  46. nextWeek: function () {
  47. return 'dddd [a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT';
  48. },
  49. lastDay: function () {
  50. return '[ahir a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT';
  51. },
  52. lastWeek: function () {
  53. return (
  54. '[el] dddd [passat a ' +
  55. (this.hours() !== 1 ? 'les' : 'la') +
  56. '] LT'
  57. );
  58. },
  59. sameElse: 'L',
  60. },
  61. relativeTime: {
  62. future: "d'aquí %s",
  63. past: 'fa %s',
  64. s: 'uns segons',
  65. ss: '%d segons',
  66. m: 'un minut',
  67. mm: '%d minuts',
  68. h: 'una hora',
  69. hh: '%d hores',
  70. d: 'un dia',
  71. dd: '%d dies',
  72. M: 'un mes',
  73. MM: '%d mesos',
  74. y: 'un any',
  75. yy: '%d anys',
  76. },
  77. dayOfMonthOrdinalParse: /\d{1,2}(r|n|t|è|a)/,
  78. ordinal: function (number, period) {
  79. var output =
  80. number === 1
  81. ? 'r'
  82. : number === 2
  83. ? 'n'
  84. : number === 3
  85. ? 'r'
  86. : number === 4
  87. ? 't'
  88. : 'è';
  89. if (period === 'w' || period === 'W') {
  90. output = 'a';
  91. }
  92. return number + output;
  93. },
  94. week: {
  95. dow: 1, // Monday is the first day of the week.
  96. doy: 4, // The week that contains Jan 4th is the first week of the year.
  97. },
  98. });