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#to_datetime before calendar reform #73

Merged
merged 1 commit into from
Aug 8, 2022

Conversation

nobu
Copy link
Member

@nobu nobu commented Aug 8, 2022

Time is always in the proleptic Gregorian calendar.
Also DateTime#to_time should convert to the Gregorian calendar first, before extracting its components.

https://bugs.ruby-lang.org/issues/18946#change-98527

Time is always in the proleptic Gregorian calendar.
Also DateTime#to_time should convert to the Gregorian calendar first,
before extracting its components.

https://bugs.ruby-lang.org/issues/18946#change-98527
@nobu nobu merged commit b2aee75 into ruby:master Aug 8, 2022
@nobu nobu deleted the fix-to_datetime branch August 8, 2022 14:50
eileencodes added a commit to rails/rails that referenced this pull request Aug 18, 2022
In Ruby trunk date changed to use the gregorian calendar in
ruby/date#73.

This had the result that dates not in the gregorian calendar can't be
compared to times not in the gregorian calendar. Since this test isn't
testing datetime comparison but rather that bc timestamps can be stored
in the database, we can compare with `Time.new(0) - 1.week` rather than
`Date.new(0) - 1.week`. I think this might be a bug in Ruby but I'm not
sure there's a great fix. For now however, let's get this test passing.
eileencodes added a commit to rails/rails that referenced this pull request Dec 16, 2022
In Ruby trunk date changed to use the gregorian calendar in
ruby/date#73.

This had the result that dates not in the gregorian calendar can't be
compared to times not in the gregorian calendar. Since this test isn't
testing datetime comparison but rather that bc timestamps can be stored
in the database, we can compare with `Time.new(0) - 1.week` rather than
`Date.new(0) - 1.week`. I think this might be a bug in Ruby but I'm not
sure there's a great fix. For now however, let's get this test passing.
eileencodes added a commit to rails/rails that referenced this pull request Jan 5, 2023
In Ruby trunk date changed to use the gregorian calendar in
ruby/date#73.

This had the result that dates not in the gregorian calendar can't be
compared to times not in the gregorian calendar. Since this test isn't
testing datetime comparison but rather that bc timestamps can be stored
in the database, we can compare with `Time.new(0) - 1.week` rather than
`Date.new(0) - 1.week`. I think this might be a bug in Ruby but I'm not
sure there's a great fix. For now however, let's get this test passing.
eileencodes added a commit to rails/rails that referenced this pull request Jan 5, 2023
In Ruby trunk date changed to use the gregorian calendar in
ruby/date#73.

This had the result that dates not in the gregorian calendar can't be
compared to times not in the gregorian calendar. Since this test isn't
testing datetime comparison but rather that bc timestamps can be stored
in the database, we can compare with `Time.new(0) - 1.week` rather than
`Date.new(0) - 1.week`. I think this might be a bug in Ruby but I'm not
sure there's a great fix. For now however, let's get this test passing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant