moment / luxon

⏱ A library for working with dates and times in JS
https://moment.github.io/luxon
MIT License
15.05k stars 730 forks source link

DateTime fromFormat() is considers non-valid 24-hr formats as valid #1625

Open eh1160 opened 1 month ago

eh1160 commented 1 month ago

Describe the bug DateTime fromFormat() is considers non-valid 24-hr formats as valid

To Reproduce DateTime.fromFormat('18:30 AM', 'h:mm a').isValid; // = true

Actual vs Expected behavior isValid should return false because 18 is not a valid "h" format

Desktop (please complete the following information):