travisjeffery / timecop

A gem providing "time travel", "time freezing", and "time acceleration" capabilities, making it simple to test time-dependent code. It provides a unified method to mock Time.now, Date.today, and DateTime.now in a single call.
MIT License
3.36k stars 223 forks source link

`Date.strptime` breaks for "Feb 2021", "%B %Y" on the 31st of the month #280

Closed paprikati closed 3 years ago

paprikati commented 3 years ago

If I run a spec on say 31st January, and then run Date.strptime("Feb 2021", "%B %Y") I get an invalid date error. I don't get that error for months with 31 days, so I'm assuming that is the issue.

However, if I run the same code in a rails console (i.e. without timecop wrapping it) then it works fine (I get 1 Feb 2021).

paprikati commented 3 years ago

Ah. I can see a comment on another issue saying it's fixed in 0.9.3. do we know when that might get released?

paprikati commented 3 years ago

issue originally reported at https://github.com/travisjeffery/timecop/issues/270

joshuacronemeyer commented 3 years ago

Thanks for reporting! 0.9.3 was released yesterday.