Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Time#advance to work with dates before 1001-03-07 #35659

Merged
merged 1 commit into from Mar 19, 2019

Conversation

@pixeltrix
Copy link
Member

@pixeltrix pixeltrix commented Mar 18, 2019

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
3 of 4 checks passed
3 of 4 checks passed
buildkite/rails Build #59665 failed (39 minutes, 20 seconds)
Details
codeclimate All good!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@pixeltrix pixeltrix deleted the fix-time-advance-with-historical-dates branch Mar 19, 2019
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
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant