es.js 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. // moment.js locale configuration
  2. // locale : spanish (es)
  3. // author : Julio Napurí : https://github.com/julionc
  4. (function (factory) {
  5. if (typeof define === 'function' && define.amd) {
  6. define(['moment'], factory); // AMD
  7. } else if (typeof exports === 'object') {
  8. module.exports = factory(require('../moment')); // Node
  9. } else {
  10. factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
  11. }
  12. }(function (moment) {
  13. var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_'),
  14. monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_');
  15. return moment.defineLocale('es', {
  16. months : 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'),
  17. monthsShort : function (m, format) {
  18. if (/-MMM-/.test(format)) {
  19. return monthsShort[m.month()];
  20. } else {
  21. return monthsShortDot[m.month()];
  22. }
  23. },
  24. weekdays : 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
  25. weekdaysShort : 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
  26. weekdaysMin : 'Do_Lu_Ma_Mi_Ju_Vi_Sá'.split('_'),
  27. longDateFormat : {
  28. LT : 'H:mm',
  29. LTS : 'LT:ss',
  30. L : 'DD/MM/YYYY',
  31. LL : 'D [de] MMMM [de] YYYY',
  32. LLL : 'D [de] MMMM [de] YYYY LT',
  33. LLLL : 'dddd, D [de] MMMM [de] YYYY LT'
  34. },
  35. calendar : {
  36. sameDay : function () {
  37. return '[hoy a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  38. },
  39. nextDay : function () {
  40. return '[mañana a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  41. },
  42. nextWeek : function () {
  43. return 'dddd [a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  44. },
  45. lastDay : function () {
  46. return '[ayer a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  47. },
  48. lastWeek : function () {
  49. return '[el] dddd [pasado a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  50. },
  51. sameElse : 'L'
  52. },
  53. relativeTime : {
  54. future : 'en %s',
  55. past : 'hace %s',
  56. s : 'unos segundos',
  57. m : 'un minuto',
  58. mm : '%d minutos',
  59. h : 'una hora',
  60. hh : '%d horas',
  61. d : 'un día',
  62. dd : '%d días',
  63. M : 'un mes',
  64. MM : '%d meses',
  65. y : 'un año',
  66. yy : '%d años'
  67. },
  68. ordinalParse : /\d{1,2}º/,
  69. ordinal : '%dº',
  70. week : {
  71. dow : 1, // Monday is the first day of the week.
  72. doy : 4 // The week that contains Jan 4th is the first week of the year.
  73. }
  74. });
  75. }));