Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search dates fails depending on whitespaces around prefix ":" #768

Open
Fabma opened this issue Aug 12, 2020 · 0 comments
Open

Search dates fails depending on whitespaces around prefix ":" #768

Fabma opened this issue Aug 12, 2020 · 0 comments

Comments

@Fabma
Copy link

Fabma commented Aug 12, 2020

Version:

  • dateparser==0.76

How to reproduce:

# parsed date is correct
search_dates("Date 22.06.2020", languages=["de"], settings={'DATE_ORDER': 'DMY'})
> [('22.06.2020', datetime.datetime(2020, 6, 22, 0, 0))]

# parsed date is wrong (prefix " :")
search_dates("Date :22.06.2020", languages=["de"], settings={'DATE_ORDER': 'DMY'})
> [('22.06.2020', datetime.datetime(1900, 1, 1, 2, 2))]

# parsed date is different, but still wrong (prefix ":")
search_dates("Date:22.06.2020", languages=["de"], settings={'DATE_ORDER': 'DMY'})
> [('2020', datetime.datetime(2020, 8, 12, 0, 0))]

# parsed date is correct (prefix ": ")
search_dates("Date: 22.06.2020", languages=["de"], settings={'DATE_ORDER': 'DMY'})
> [('22.06.2020', datetime.datetime(2020, 6, 22, 0, 0))]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants