Skip to content

Conversation

@pixeltrix
Copy link
Contributor

In #10634 the behavior of Time#advance was changed to maintain a proleptic gregorian calendar for dates before calendar reform. However it didn't full address dates a long time before calendar reform and they gradually drift away from the proleptic calendar the further you go back in time. Fix this by always converting the date to gregorian before calling advance which sets the reform date to -infinity.

In #10634 the behavior of Time#advance was changed to maintain a
proleptic gregorian calendar for dates before calendar reform. However
it didn't full address dates a long time before calendar reform and
they gradually drift away from the proleptic calendar the further you
go back in time. Fix this by always converting the date to gregorian
before calling advance which sets the reform date to -infinity.
@pixeltrix pixeltrix self-assigned this Mar 18, 2019
@pixeltrix pixeltrix merged commit 4a79707 into master Mar 19, 2019
@pixeltrix pixeltrix deleted the fix-time-advance-with-historical-dates branch March 19, 2019 11:37
suketa added a commit to suketa/rails_sandbox that referenced this pull request Sep 16, 2019
Fix Time#advance to work with dates before 1001-03-07
rails/rails#35659
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants