-
Notifications
You must be signed in to change notification settings - Fork 729
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
Format "DDD" with locale "ES" use Incorrect Fixed Date Format #1645
Comments
I don't own a Mac to test this on, however on Chrome I cannot reproduce this. new Intl.DateTimeFormat('es', { year: 'numeric', month: 'long', day: 'numeric' }).formatToParts(new Date(1555555555555)); If it functions correctly, it should output: [
{
"type": "day",
"value": "18"
},
{
"type": "literal",
"value": " de "
},
{
"type": "month",
"value": "abril"
},
{
"type": "literal",
"value": " de "
},
{
"type": "year",
"value": "2019"
}
] |
@diesieben07 it returns
And
In my opinion the issue is related to the specific format |
Thank you for the info. Unfortunately that output suggests Unfortunately I really don't know how to proceed here, because I cannot reproduce this issue. |
Describe the bug
If you use
DateTime.expandFormat("DDD", { locale: "en" })
you getMMMM d, yyyyy
and that's correct (although why 5y
instead of 4?).But when you use it with the locale
es
likeDateTime.expandFormat("DDD", { locale: "es" })
you getd de abril de 2019
and this is wrong. Is only allowing to specify the day, the rest month and year are fixed to the current month and the year 2019.So
DateTime.fromFormat("2 de abril de 2019", "DDD).isValid
will be true, but changing the month or year will return invalid since that part is fixed internally on the library.To Reproduce
Actual vs Expected behavior
DateTime.expandFormat("DDD", { locale: "es" })
should returnd de MMMM de yyyy
DateTime.fromFormat("2 de abril de 2024", "DDD").isValid
should returntrue
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: