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

**Describe the bug** #1577

Closed
KengSSK opened this issue Jan 22, 2024 · 0 comments
Closed

**Describe the bug** #1577

KengSSK opened this issue Jan 22, 2024 · 0 comments

Comments

@KengSSK
Copy link

KengSSK commented Jan 22, 2024

Describe the bug
Correct me if I'm wrong, but shouldn't this return an invalid DateTime?

luxon.DateTime.fromFormat('11-08-2023 15:00 AM', 'MM-dd-yyyy hh:mm a').toString()
// '2023-11-08T15:00:00.000-06:00'

To Reproduce
Just go to the Luxon docs and paste the example above into the console.
image

Actual vs Expected behavior
The date string supplied is using hour 15 with a meridian, and the format string is expecting 12-hour time. Shouldn't luxon notice that hour 15 is out of bounds and return an Invalid object?

Desktop (please complete the following information):

  • OS: MacOS Ventura 13.1
  • Browser: Chrome 118.0.5993.117
  • Luxon version: 3.4.4
  • Your timezone: America/Chicago

Originally posted by @Matthematic in #1549

@diesieben07 diesieben07 closed this as not planned Won't fix, can't repro, duplicate, stale Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants