scrapinghub / dateparser

python parser for human readable dates

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Parsing very short weekday names

jimbofreedman opened this issue · comments

(Python 3.10.2/dateparser 1.1.8

>>> DAYS = ["Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"]
>>> for d in DAYS:
...   print(dateparser.parse(d))
... 
2023-06-19 00:00:00
None
None
None
2023-06-16 00:00:00
2023-06-17 00:00:00
2023-02-19 00:00:00
>>> 

Dateparser can identify Mo/Fr/Sa/Su as days of the week on their own but not Tu/We/Th - is this by design - perhaps because they'd be ambiguous?

I don’t think it is by design, and I would expect them to work at least if you pass languages=["en"], so I think it might be a bug.

one ques = if you see the above output the date of su is of feb month, but the current month is 06