8000 Format "DDD" with locale "ES" use Incorrect Fixed Date Format · Issue #1645 · moment/luxon · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Format "DDD" with locale "ES" use Incorrect Fixed Date Format #1645
Open
@dev2xl

Description

@dev2xl

Describe the bug

If you use DateTime.expandFormat("DDD", { locale: "en" }) you get MMMM d, yyyyy and that's correct (although why 5 y instead of 4?).
But when you use it with the locale es like DateTime.expandFormat("DDD", { locale: "es" }) you get d 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.

SoDateTime.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

DateTime.expandFormat("DDD", { locale: "es" })
DateTime.fromFormat("2 de abril de 2024", "DDD")

Actual vs Expected behavior
DateTime.expandFormat("DDD", { locale: "es" }) should return d de MMMM de yyyy
DateTime.fromFormat("2 de abril de 2024", "DDD").isValid should return true

Desktop (please complete the following information):

  • Mac
  • Chrome, Safari, anything
  • Luxon version 3.4.4
  • America/New_York

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0