ca.js 2.9KB

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