es.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. //! moment.js locale configuration
  2. //! locale : Spanish [es]
  3. //! author : Julio Napurí : https://github.com/julionc
  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. var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_');
  11. var monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_');
  12. var monthsParse = [/^ene/i, /^feb/i, /^mar/i, /^abr/i, /^may/i, /^jun/i, /^jul/i, /^ago/i, /^sep/i, /^oct/i, /^nov/i, /^dic/i];
  13. var monthsRegex = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;
  14. var es = moment.defineLocale('es', {
  15. months : 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'),
  16. monthsShort : function (m, format) {
  17. if (!m) {
  18. return monthsShortDot;
  19. } else if (/-MMM-/.test(format)) {
  20. return monthsShort[m.month()];
  21. } else {
  22. return monthsShortDot[m.month()];
  23. }
  24. },
  25. monthsRegex : monthsRegex,
  26. monthsShortRegex : monthsRegex,
  27. monthsStrictRegex : /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,
  28. monthsShortStrictRegex : /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,
  29. monthsParse : monthsParse,
  30. longMonthsParse : monthsParse,
  31. shortMonthsParse : monthsParse,
  32. weekdays : 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
  33. weekdaysShort : 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
  34. weekdaysMin : 'do_lu_ma_mi_ju_vi_sá'.split('_'),
  35. weekdaysParseExact : true,
  36. longDateFormat : {
  37. LT : 'H:mm',
  38. LTS : 'H:mm:ss',
  39. L : 'DD/MM/YYYY',
  40. LL : 'D [de] MMMM [de] YYYY',
  41. LLL : 'D [de] MMMM [de] YYYY H:mm',
  42. LLLL : 'dddd, D [de] MMMM [de] YYYY H:mm'
  43. },
  44. calendar : {
  45. sameDay : function () {
  46. return '[hoy a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  47. },
  48. nextDay : function () {
  49. return '[mañana a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  50. },
  51. nextWeek : function () {
  52. return 'dddd [a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  53. },
  54. lastDay : function () {
  55. return '[ayer a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  56. },
  57. lastWeek : function () {
  58. return '[el] dddd [pasado a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  59. },
  60. sameElse : 'L'
  61. },
  62. relativeTime : {
  63. future : 'en %s',
  64. past : 'hace %s',
  65. s : 'unos segundos',
  66. ss : '%d segundos',
  67. m : 'un minuto',
  68. mm : '%d minutos',
  69. h : 'una hora',
  70. hh : '%d horas',
  71. d : 'un día',
  72. dd : '%d días',
  73. M : 'un mes',
  74. MM : '%d meses',
  75. y : 'un año',
  76. yy : '%d años'
  77. },
  78. dayOfMonthOrdinalParse : /\d{1,2}º/,
  79. ordinal : '%dº',
  80. week : {
  81. dow : 1, // Monday is the first day of the week.
  82. doy : 4 // The week that contains Jan 4th is the first week of the year.
  83. }
  84. });
  85. return es;
  86. })));