jeremyevans / home_run

Fast Date/DateTime classes for ruby :: Unmaintained, unnecessary on ruby 1.9.3+
Other
465 stars 10 forks source link

adding 1.year results in incorrect new date #26

Closed iros closed 13 years ago

iros commented 13 years ago

I recently switched to home_run and observed several failures in my rails app test suite. Upon investigating further, here is an example of the sort of behavior I am seeing.

start = DateTime::parse("January 1 1943")

Fri, 01 Jan 1943 00:00:00 +0000 start + 1.year Tue, 10 Oct 88344 00:00:00 +0000

Naturally, I expected Fri, 01 Jan 1944 00:00:00 +0000.

jeremyevans commented 13 years ago

I believe this is the bug in ActiveSupport described here: https://rails.lighthouseapp.com/projects/8994/tickets/6062-activesupport-assumes-too-much-about-how-datedatetime-are-implemented-breaking-some-usage-with-home_run.

The active_support is actually broken on ruby-head as well since tadf committed switch_hitter (replacing the pure ruby date library with a C extension). I'll add that to the lighthouse ticket.