-
-
Notifications
You must be signed in to change notification settings - Fork 982
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
Provide methods for converting to java.time #254
Comments
My preferred approach to this is to make the Joda-Time classes implement |
We are probably going to try that fork at least for our own internal purposes, since full java.time migration for us will take years. |
I would also suggest adding factory and instance methods to match Java 8. If you do fork publicly, I'm happy to advise. |
We're planning to discuss this some tomorrow at Google. Is there anything else we should keep in mind? (Sorry for the late notice....) One thing I'm wondering is whether it would be better to provide static conversion methods instead. They could go in a separate, Java-8-only artifact (presumably in a subpackage to avoid problems with modules). Naturally, this would be less convenient, and if Joda Time ever does require Java 8, it will be a wart that the methods live there instead of as instance methods. On the other hand, it avoids a Java 5 / Java 8 split, and we certainly understand the appeal of that :) |
(Subjectively, I feel that instance methods are quite a lot more readable, usable, findable, everything-able, and .... I want them!) |
I'm imagining that the goal would be to:
Figuring out the exact list of these methods is the hard part of the task. Overall, my thought was to try and bring the API of Joda-Time close to that of JSR-310 simply by making the API larger. I'm not too concerned about a Java 5 / Java 8 split, as Joda-Time is pretty stable and even if a bug is found it is often just be documented due to JDK-like backwards compatibility. Having a Java 8 only static helper doesn't seem like it would be that useful by comparison with full integration, so I'm with @kevinb9n there. |
Just like Joda Time provides methods for converting to/from
java.util.Date/Calendar
, it would be beneficial - not least for migration - to provide methods to convert to/from the new Java 8java.time
classes, such asorg.joda.time.LocalDate
->java.time.LocalDate
.The text was updated successfully, but these errors were encountered: