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

Parsing date from format hh gives valid true even if the hour is greater than 12 #1655

Open
rohitkhatri opened this issue Sep 21, 2024 · 1 comment

Comments

@rohitkhatri
Copy link

Describe the bug
Parsing time from string based on a hh:mm a format gives valid true even if the hour is greater than 12

To Reproduce

import { DateTime } from "luxon";

const date = DateTime.fromFormat('13:00 AM', 'hh:mm a', {});
console.log(date);
console.log(date.isValid);

Actual vs Expected behavior
It should give invalid since the definition of hh is 12 hours clock

Desktop (please complete the following information):

  • OS: MacOS M1
  • Browser Chrome: 123
  • Luxon version: 3.1.0
  • Your timezone: Asia/Kolkata
@rohitkhatri
Copy link
Author

Is there any workaround for this for now?

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

1 participant