Open clach04 opened 3 years ago
Hmm interesting. I've never seen anyone write 7.15pm but I can believe that people do. I'm open to supporting it if you can fix the root cause for the failing tests. Treating it as a date if no am/pm is provided sounds like a reasonable approach.
Off the top of my head, you could either accomplish that by adding a lookahead for am/pm to the period pattern, or add a hack in the matcher logic to prefer date over time if the match length is equivalent and the divider is a .
. The latter feels hackier so I'd probably prefer the lookahead, but not sure yet if that will add other problems. Looking forward to the PR!
Whilst I don't personally use times of the form 7.15pm (with a
.
rather than:
), I have come across these in the wild and the people using this form thought it was standard.I have a change and a test that adds support, but it fails 2 date tests:
Is this something you would consider supporting? I'm not sure what the heuristic would be but perhaps if there is am/pm present treat it as a time otherwise treat it as a date as it does today?
(EDITED for formatting)