cmp-natdat
cmp-natdat copied to clipboard
Allow skipping the colon when parsing time
Sometimes the colon is unnecessary when resolving the time.
- 725 -> 7:25
- 1420 -> 14:20
- 5 -> 5:00
Let's modify the time parser to account for these situations.
Sometimes this could lead to ambiguities:
- Oct 2 725 -> 725-10-2 (just the date) or 2023-10-02 7:25
I believe we should only make the colon optional when the format expects a time, so:
- after a relative date
- after a day of the week
- at the beginning of the query