Skip to content

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

Open

Description

@Fabma

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))]

Activity

  1. added
    Type: Bug - Language
    on Aug 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: Bug - Languagesearch_dates

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions