Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix es round tripping dates with Wednesday #1792

Merged
merged 4 commits into from Jul 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/locale/es/_lib/match/index.js
Expand Up @@ -37,7 +37,7 @@ var matchDayPatterns = {
narrow: /^[dlmjvs]/i,
short: /^(do|lu|ma|mi|ju|vi|sa)/i,
abbreviated: /^(dom|lun|mar|mie|jue|vie|sab)/i,
wide: /^(domingo|lunes|martes|miercoles|jueves|viernes|s[áa]bado)/i
wide: /^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i
}
var parseDayPatterns = {
narrow: [/^d/i, /^l/i, /^m/i, /^m/i, /^j/i, /^v/i, /^s/i],
Expand Down
4 changes: 2 additions & 2 deletions src/locale/es/snapshot.md
Expand Up @@ -166,7 +166,7 @@
| | | 1453-05-29T23:59:59.999Z | 29 may 1453 | 1453-05-29T00:00:00.000Z |
| | PPP | 1987-02-11T12:13:14.015Z | 11 de febrero de 1987 | 1987-02-11T00:00:00.000Z |
| | | 1453-05-29T23:59:59.999Z | 29 de mayo de 1453 | 1453-05-29T00:00:00.000Z |
| | PPPP | 1987-02-11T12:13:14.015Z | miércoles, 11 de febrero de 1987 | Invalid Date |
| | PPPP | 1987-02-11T12:13:14.015Z | miércoles, 11 de febrero de 1987 | 1987-02-11T00:00:00.000Z |
| | | 1453-05-29T23:59:59.999Z | domingo, 29 de mayo de 1453 | 1453-05-29T00:00:00.000Z |
| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
Expand All @@ -182,7 +182,7 @@
| | | 1453-05-29T23:59:59.999Z | 29 may 1453, 23:59:59 | 1453-05-29T23:59:59.000Z |
| | PPPppp | 1987-02-11T12:13:14.015Z | 11 de febrero de 1987 a las 12:13:14 GMT+0 | Errored |
| | | 1453-05-29T23:59:59.999Z | 29 de mayo de 1453 a las 23:59:59 GMT+0 | Errored |
| | PPPPpppp | 1987-02-11T12:13:14.015Z | miércoles, 11 de febrero de 1987 a las 12:13:14 GMT+00:00 | Invalid Date |
| | PPPPpppp | 1987-02-11T12:13:14.015Z | miércoles, 11 de febrero de 1987 a las 12:13:14 GMT+00:00 | Errored |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the exception

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kossnocorp This exception is unrelated and is a fundamental problem with the parser. My change just allowed the parser to get further. If you look through the snapshots for all locales you will see that anytime pppp, ppp always results in an exception. Including en-US

https://github.com/date-fns/date-fns/blob/master/src/locale/en-US/snapshot.md

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, thanks!

| | | 1453-05-29T23:59:59.999Z | domingo, 29 de mayo de 1453 a las 23:59:59 GMT+00:00 | Errored |

## `formatDistance`
Expand Down