Skip to content

Search dates fails with french language selector if string contains "-" #767

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

Open
Fabma opened this issue Aug 12, 2020 · 0 comments
Open
Labels
search_dates Type: Bug - Language Subtype of bug, related to language data

Comments

@Fabma
Copy link

Fabma commented Aug 12, 2020

Version:

  • dateparser==0.7.6

How to reproduce:

# correctly parsed date
search_dates("HelloDate 26.09.2019", languages=["de", "fr"], settings={'DATE_ORDER': 'DMY'})
> [('26.09.2019', datetime.datetime(2019, 9, 26, 0, 0))]

# the "-" in "Hello-Date" leads to a wrong date
search_dates("Hello-Date 26.09.2019", languages=["de", "fr"], settings={'DATE_ORDER': 'DMY'})
> [('2019', datetime.datetime(2019, 8, 12, 0, 0))]

# omitting french language leads to correctly parsed date again
search_dates("Hello-Date 26.09.2019", languages=["de"], settings={'DATE_ORDER': 'DMY'})
Out[9]: [('26.09.2019', datetime.datetime(2019, 9, 26, 0, 0))]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
search_dates Type: Bug - Language Subtype of bug, related to language data
Projects
None yet
Development

No branches or pull requests

3 participants