Skip to content

PREFER_DATES_FROM future does not properly increment month #1275

@shrx

Description

@shrx

It seems that if the day of week in the future falls into the next month, the month is not properly incremented in the returned datetime object.

datetime.now()
datetime.datetime(2025, 5, 31, 11, 1, 49, 623752)

dateparser.parse("Monday", settings={'PREFER_DATES_FROM': 'past'})
datetime.datetime(2025, 5, 26, 0, 0)

dateparser.parse("Monday", settings={'PREFER_DATES_FROM': 'future'})
datetime.datetime(2025, 5, 2, 0, 0) # should be: datetime.datetime(2025, 6, 2, 0, 0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions