andrewplummer / Sugar

A Javascript library for working with native objects.
https://sugarjs.com/
MIT License
4.53k stars 306 forks source link

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

Closed Shlomo-T closed 6 years ago

Shlomo-T commented 6 years ago

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)