ca.js 3.7 KB

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