Skip to content

Inconsistent behaviour between search_dates and parse #504

Closed

Description

@alikasundara

this test was performed on the 17th Feb 2019. "On Monday" refers to then next Monday (18th Feb).
parse seems to be correct -> datetime(2019, 2, 18, 7, 0), but search_dates interprets the 7 as a month.

>>> dateparser.parse("on Monday at 7am", settings={'PREFER_DATES_FROM': 'future'})
datetime.datetime(2019, 2, 18, 7, 0)
>>> search_dates("on Monday at 7am", settings={'PREFER_DATES_FROM': 'future'})
[('on Monday at 7am', datetime.datetime(2019, 7, 17, 0, 0))]

If I use 7:00 it's working fine. 7, 7am or 7 am are all inconsistent.

Tested with:

  • dateparser (0.7.1) and (0.7.0)
  • Python 3.6.5
  • Linux kernel 4.14.65, x86-64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions