bear / parsedatetime

Parse human-readable date/time strings
Apache License 2.0
695 stars 106 forks source link

feature: Parsing of Nth of Month #205

Open AgDude opened 7 years ago

AgDude commented 7 years ago

For example cal.parseDT('2nd of nov') returns datetime.datetime(2017, 11, 1, 0, 0) ( the first of november). I would like to be able to support both "2nd" and "Second" if possible.

AgDude commented 7 years ago

Looks like this is also mentioned in #190. I'll leave this open, being personally in favor of more specific issues.

uriva commented 6 years ago

This is of course a ridiculous solution but nonetheless I'm using it: text = re.sub(r"(\b\d\d?(rd|nd|st|th)) of ([^\s]+)\b", r"\3 \1", text)

I guess this decent lib isn't being maintained anymore. Too bad as it is a decent one.