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

Date advancing near the 1582 reformation does not behave like MRI #4242

Open
headius opened this issue Oct 22, 2016 · 2 comments
Open

Date advancing near the 1582 reformation does not behave like MRI #4242

headius opened this issue Oct 22, 2016 · 2 comments

Comments

@headius
Copy link
Member

headius commented Oct 22, 2016

Environment

JRuby master (pre-9.1.6.0)
Rails master (pre-5.1)

Expected Behavior

Date advancing should honor the 1582 time reformation in the following examples:

puts Date.new(1581,10,10) >> 12 # => 1582-10-04
puts Date.new(1582,9,5) >> 1 # 1582-10-04

Actual Behavior

Under JRuby, these two examples result in 1582-10-20 and 1582-10-15, respectively. This causes errors in at least two rails/activesupport tests:

  1) Failure:
DateExtCalculationsTest#test_next_year_in_calendar_reform [/Users/headius/projects/rails/activesupport/test/core_ext/date_ext_test.rb:138]:
Expected: Thu, 04 Oct 1582
  Actual: Wed, 20 Oct 1582


  2) Failure:
DateExtCalculationsTest#test_advance_in_calendar_reform [/Users/headius/projects/rails/activesupport/test/core_ext/date_ext_test.rb:166]:
Expected: Thu, 04 Oct 1582
  Actual: Fri, 15 Oct 1582

I looked up when these tests were added, and it appears they were added to test a monkey-patch applied to 1.8 for a date reform fix only in 1.9 and higher. Out implementation of date does not appear to match.

@headius
Copy link
Member Author

headius commented May 15, 2018

I'm not sure we're ever going to fix this, but it's traceable to an MRI test so I'll just detarget it.

@headius headius removed this from the JRuby 9.2.1.0 milestone May 15, 2018
@headius
Copy link
Member Author

headius commented Feb 1, 2023

This would be fixed by #6913.

@headius headius removed the ruby 1.9 label Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants