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 comparison as java objects #1520

Closed
crschummer opened this Issue Feb 21, 2014 · 2 comments

Comments

Projects
None yet
4 participants
@crschummer
Copy link

commented Feb 21, 2014

Starting in jruby-1.7.5 the compareTo of Dates converted to java objects seems to be broken:

in 1.7.4:
jruby-1.7.4 :003 > Date.today.to_java.compareTo((Date.today - 1).to_java)
=> 1
jruby-1.7.4 :004 > Date.today.to_java.compareTo((Date.today).to_java)
=> 0
jruby-1.7.4 :005 > Date.today.to_java.compareTo((Date.today + 1).to_java)
=> -1

In 1.7.5:
jruby-1.7.5 :005 > Date.today.to_java.compareTo((Date.today - 1).to_java)
=> 0
jruby-1.7.5 :006 > Date.today.to_java.compareTo((Date.today).to_java)
=> 0
jruby-1.7.5 :007 > Date.today.to_java.compareTo((Date.today + 1).to_java)
=> 0

This is also the case in the 1.7.10 release.

@MSNexploder

This comment has been minimized.

Copy link
Contributor

commented Jul 15, 2014

i guess this could be closed.

JRuby 1.7.13

irb(main):001:0> Date.today.to_java.compareTo((Date.today - 1).to_java)
=> 1
irb(main):002:0> Date.today.to_java.compareTo((Date.today).to_java)
=> 0
irb(main):003:0> Date.today.to_java.compareTo((Date.today + 1).to_java)
=> -1
@mkristian

This comment has been minimized.

Copy link
Member

commented Jul 15, 2014

@MSNexploder thanx for pointing this out

@mkristian mkristian closed this Jul 15, 2014

@enebo enebo modified the milestones: JRuby 1.7.14, JRuby 1.7.15 Aug 27, 2014

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.