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

Projects
None yet
1 participant
@pixeltrix
Copy link
Member

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.

Fix Time#advance to work with dates before 1001-03-07
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.

@rails-bot rails-bot bot added the activesupport label Mar 18, 2019

@pixeltrix pixeltrix self-assigned this Mar 18, 2019

@pixeltrix pixeltrix merged commit 4a79707 into master Mar 19, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.