Skip to content

Commit

Permalink
Fix Spanish accents in Saturday and Wednesday(#1872)
Browse files Browse the repository at this point in the history
Co-authored-by: David Triana <datria@microsoft.com>
  • Loading branch information
dtriana and David Triana committed Jul 17, 2020
1 parent 05808ce commit e152f5e
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 11 deletions.
46 changes: 40 additions & 6 deletions src/locale/es/_lib/localize/index.js
Expand Up @@ -14,15 +14,49 @@ var quarterValues = {

var monthValues = {
narrow: ['e', 'f', 'm', 'a', 'm', 'j', 'j', 'a', 's', 'o', 'n', 'd'],
abbreviated: ['ene', 'feb', 'mar', 'abr', 'may', 'jun', 'jul', 'ago', 'sep', 'oct', 'nov', 'dic'],
wide: ['enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre']
abbreviated: [
'ene',
'feb',
'mar',
'abr',
'may',
'jun',
'jul',
'ago',
'sep',
'oct',
'nov',
'dic'
],
wide: [
'enero',
'febrero',
'marzo',
'abril',
'mayo',
'junio',
'julio',
'agosto',
'septiembre',
'octubre',
'noviembre',
'diciembre'
]
}

var dayValues = {
narrow: ['d', 'l', 'm', 'm', 'j', 'v', 's'],
short: ['do', 'lu', 'ma', 'mi', 'ju', 'vi', 'sa'],
abbreviated: ['dom', 'lun', 'mar', 'mié', 'jue', 'vie', 'sab'],
wide: ['domingo', 'lunes', 'martes', 'miércoles', 'jueves', 'viernes', 'sábado']
abbreviated: ['dom', 'lun', 'mar', 'mié', 'jue', 'vie', 'sáb'],
wide: [
'domingo',
'lunes',
'martes',
'miércoles',
'jueves',
'viernes',
'sábado'
]
}

var dayPeriodValues = {
Expand Down Expand Up @@ -90,7 +124,7 @@ var formattingDayPeriodValues = {
}
}

function ordinalNumber (dirtyNumber) {
function ordinalNumber(dirtyNumber) {
var number = Number(dirtyNumber)
return number + 'º'
}
Expand All @@ -106,7 +140,7 @@ var localize = {
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: 'wide',
argumentCallback: function (quarter) {
argumentCallback: function(quarter) {
return Number(quarter) - 1
}
}),
Expand Down
39 changes: 34 additions & 5 deletions src/locale/es/_lib/match/index.js
Expand Up @@ -11,7 +11,10 @@ var matchEraPatterns = {
}
var parseEraPatterns = {
any: [/^ac/i, /^dc/i],
wide: [/^(antes de cristo|antes de la era com[uú]n)/i, /^(despu[eé]s de cristo|era com[uú]n)/i]
wide: [
/^(antes de cristo|antes de la era com[uú]n)/i,
/^(despu[eé]s de cristo|era com[uú]n)/i
]
}

var matchQuarterPatterns = {
Expand All @@ -29,8 +32,34 @@ var matchMonthPatterns = {
wide: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i
}
var parseMonthPatterns = {
narrow: [/^e/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
any: [/^en/i, /^feb/i, /^mar/i, /^abr/i, /^may/i, /^jun/i, /^jul/i, /^ago/i, /^sep/i, /^oct/i, /^nov/i, /^dic/i]
narrow: [
/^e/i,
/^f/i,
/^m/i,
/^a/i,
/^m/i,
/^j/i,
/^j/i,
/^a/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i
],
any: [
/^en/i,
/^feb/i,
/^mar/i,
/^abr/i,
/^may/i,
/^jun/i,
/^jul/i,
/^ago/i,
/^sep/i,
/^oct/i,
/^nov/i,
/^dic/i
]
}

var matchDayPatterns = {
Expand Down Expand Up @@ -65,7 +94,7 @@ var match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: function (value) {
valueCallback: function(value) {
return parseInt(value, 10)
}
}),
Expand All @@ -82,7 +111,7 @@ var match = {
defaultMatchWidth: 'wide',
parsePatterns: parseQuarterPatterns,
defaultParseWidth: 'any',
valueCallback: function (index) {
valueCallback: function(index) {
return index + 1
}
}),
Expand Down

0 comments on commit e152f5e

Please sign in to comment.