UNPKG

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