jruby/jruby — pull request #890 by eregon (2013-07-16 18:38:52+00:00)
Title: Date library using Joda-Time (v2)

The branch was move to my own fork so I can happily push --force if I need to rework the first commits.

There are many problems for now.

* Date/DateTime constructors are very liberal for the arguments, they accept negative args and such. Replacing them with Joda is very hard (except for maybe for `Date.civil`).
* Therefore, decoupling from ajd is pretty hard, and anyway we need ajd in a couple of case (Date.jd, Date#ajd, etc).
* Joda's DateTime only has ms precision, but `date.rb` says it has ns, but actually is arbitrary (through Rational).
* So we are almost obligated to keep `@ajd` in the instance as a Rational to keep the precision.

I am not sure Joda's DateTime methods such as getYear() provide a significant speedup, I should measure that to see if it is worth changing (it is changed for now when precision is not an issue).

There is an additonnal test failure about meeting a Bignum (should have been a long). That would mean that time is not representable by Joda-Time, I'll check.

Maybe the biggest problem is in parsing/dumping with str{f,p}time? In that case I should probably focus on that and the solution of building lazily the Joda DateTime might be a good option.