chrono
chrono copied to clipboard
Incorrect handling of midnight to noon range
Input text: give me those figures from noon to midnight Output: Start: Thu Apr 19 2018 00:00:00 GMT+0100 (BST) End: Thu Apr 19 2018 12:00:00 GMT+0100 (BST)
Input text: give me those figures from midnight to noon Output: Start: Thu Apr 19 2018 00:00:00 GMT+0100 (BST) End: Thu Apr 19 2018 00:00:00 GMT+0100 (BST)
First case gets the times correct and sorts them into the correct order - although the ambiguity around which midnight causes problems, (worth documenting as a warning?)
Second case correctly identifies that there are two datetimes, but seems unable to parse correctly. I've done some further tests and the problem appears to be recognition of the noon value in that context. For example "from 9am to noon" gives 09:00:00 twice, and "from midnight to 12:00" gives the desired range of 00:00-12:00