andrewplummer / Sugar

A Javascript library for working with native objects.

Home Page:https://sugarjs.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to parse Italian dates that contains the word 'mar' (martedì)

Shlomo-T opened this issue · comments

I tried to parse dates from Italian source and noticed that it fails to parse dates with the word mar (I assume that dateparse confuses it with march or something similar).
Here my attempts to parse the date:

parsed_date = dateparser.parse("mar gen 23, 2018 12:23 pm", settings=None, date_formats=['%a %b %d, %Y %H:%M %p'])
parsed_date is None

output: True

And here it works when I use SKIP_TOKENS to skip 'mar':

dateparser.parse("mar gen 23, 2018 12:23 pm", settings={'SKIP_TOKENS': ['mar']}, date_formats=['%a %b %d, %Y %H:%M %p'])

output: datetime.datetime(2018, 1, 23, 12, 23)