es.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_');
  12. var es = moment.defineLocale('es', {
  13. months : 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'),
  14. monthsShort : function (m, format) {
  15. if (/-MMM-/.test(format)) {
  16. return monthsShort[m.month()];
  17. } else {
  18. return monthsShortDot[m.month()];
  19. }
  20. },
  21. monthsParseExact : true,
  22. weekdays : 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
  23. weekdaysShort : 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
  24. weekdaysMin : 'do_lu_ma_mi_ju_vi_sá'.split('_'),
  25. weekdaysParseExact : true,
  26. longDateFormat : {
  27. LT : 'H:mm',
  28. LTS : 'H:mm:ss',
  29. L : 'DD/MM/YYYY',
  30. LL : 'D [de] MMMM [de] YYYY',
  31. LLL : 'D [de] MMMM [de] YYYY H:mm',
  32. LLLL : 'dddd, D [de] MMMM [de] YYYY H:mm'
  33. },
  34. calendar : {
  35. sameDay : function () {
  36. return '[hoy a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  37. },
  38. nextDay : function () {
  39. return '[mañana a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  40. },
  41. nextWeek : function () {
  42. return 'dddd [a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  43. },
  44. lastDay : function () {
  45. return '[ayer a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  46. },
  47. lastWeek : function () {
  48. return '[el] dddd [pasado a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  49. },
  50. sameElse : 'L'
  51. },
  52. relativeTime : {
  53. future : 'en %s',
  54. past : 'hace %s',
  55. s : 'unos segundos',
  56. m : 'un minuto',
  57. mm : '%d minutos',
  58. h : 'una hora',
  59. hh : '%d horas',
  60. d : 'un día',
  61. dd : '%d días',
  62. M : 'un mes',
  63. MM : '%d meses',
  64. y : 'un año',
  65. yy : '%d años'
  66. },
  67. ordinalParse : /\d{1,2}º/,
  68. ordinal : '%dº',
  69. week : {
  70. dow : 1, // Monday is the first day of the week.
  71. doy : 4 // The week that contains Jan 4th is the first week of the year.
  72. }
  73. });
  74. return es;
  75. }));