bear / parsedatetime

Parse human-readable date/time strings
Apache License 2.0
694 stars 105 forks source link

Interpret "at" as an indicator for time #279

Open giuliofoletto opened 2 years ago

giuliofoletto commented 2 years ago

It seems that parse("yesterday at 5") does not interpret 5 as time (i.e. hours). It would be nice if this was the case, as this seems a natural way of expressing time of day. From a brief look at the code, it looks like 5 on its own is too general to be interpreted as an indication of hours, however, I think that at could be used to pinpoint the meaning of the integer number.

I understand that in locales that do not use the 24h clock, the simple 5 might be ambiguous (see #210), but at the moment this also does not work in locales that use the 24h clock. For example in the de_DE locale, gestern um 5 and gestern um 17 do not get parsed correctly and the default time of the locale is used.