luxon icon indicating copy to clipboard operation
luxon copied to clipboard

Return Invalid DateTime for using meridiem with 24-hour (#1549)

Open Matthematic opened this issue 1 year ago • 2 comments

This is a fix for the case where the input '11-08-2023 15:00 AM' is parsed and interpreted as '11-08-2023 03:00 PM'. Instead of this, it should be a Datetime.Invalid with a "unit out of range" reason similar to what happens with '11-08-2023 25:00'.

fixes #1549

Matthematic avatar Jan 06 '24 17:01 Matthematic

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: Matthematic / name: Matthematic (7152ca4812d3d223f1cd87ab3db3e74141b91eff)

Sorry for the long delay in reviewing this.

While I agree this is a bug, it's a minor one, and the fix is unfortunate, because it's extra work on the hot path. I think if you can use the benchmarks not mearningfully shower that token parsing is no slower now, we can merge this.

icambron avatar Aug 03 '24 21:08 icambron