Skip to content

Date.strptime doesn't work correctly today. #434

@mikdiet

Description

@mikdiet

In my test I have a line (added just 2 month ago) that used to work, but fails today.

It's not wrapped in any timecop helpers. Actually I could reproduce it in irb:

> Date.strptime('wednesday', '%A')
(irb):2:in `<main>': invalid date (Date::Error)

            Date.strptime_without_mock_date("#{year} #{week} #{d[:wday]}", '%Y %W %w', start)
                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

but original method works.

> Date.strptime_without_mock_date('wednesday', '%A')
Wed, 01 Jan 2025

UPD: the actual string it tries to parse is "2024 53 3" - which corresponds to 32 December 🤣

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions