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
Implement all java.time classes. #7
Comments
Is using ThreeTen backport possible, license wise? If yes, I'll start porting zoned date time (which I need). https://github.com/ThreeTen/threetenbp |
Yes, both ThreeTen and this repo are BSD 3-clause. |
Does this mean that we can just copy/adapt from https://github.com/soc/threetenbp ? |
IANAL but yes. |
I'll go one step further: can we just rename the package from https://github.com/soc/threetenbp from (Sorry @nicolasstucki and @alonsodomin, I know this would sidestep the considerable effort you have already invested on the implemented classes). Actually, I see that this is a goal of such library, the issue is that they cannot test yet on Scala.js: https://github.com/soc/threetenbp/issues/22 |
@rpiaggio As you have seen, soc's idea in his fork is basically being able to rename the package namespace from I initially started trying to use soc's version, the reason I then later move to contribute here was that, for my use case (a POC/pet project), I didn't need the full library in itself and I needed to do some Scala/Scala.js cross-compilation (hence the namespace was important). Either way, the "java time library" is massive so whatever is the final translation winning in Scala-land that will mean dropping a big amount of effort done in any of the current attempts. That wouldn't be an issue for me as long as this means eventually arriving to a version that works and can be trusted. |
Well, importing the code from soc's repository and renaming the is not solving all issues with e.g. timezones, formatting and locale: https://github.com/soc/threetenbp/issues It is already possible today to just build that project manually and use it. Focus should be on implementing the missing classes referenced. |
@mkotsbak Carlos is doing a lot of great work in implementing locale support for Scala.js: soc/scala-java-time#24 @alonsodomin Carlos seems to have found a way to run tests using JUnit without having to rewrite every test from scratch. It remains to be seen whether this will work for fancy TestNG stuff like these data tables used in some tests as input. We are also currently waiting for Scala-native cross-build support to compile to native, too. |
Yes, I see that the progress seems to be very good at the moment! |
I have also flipped the switch and renamed the repo from The idea is to have milestones while work is going on implementing the missing bits for Scala.js. ¹ I'm still concerned about what this will mean regarding testing it on the JVM (might be necessary to use a JDK7?). |
@soc that actually sounds quite good. I should defo get a grip with it again as I'm hitting the limit of what I can do with this lib. |
Just as a short update: @cquiroz Is working on I continue working on scala-java-time and have published the first milestone, 2.0.0-M1 a while ago. Currently I'm implementing a ScalaJS plugin for TestNG so that we can run all the existing test suites in the browser. |
Hi, I need the |
@njouanin |
Yes, but it need |
https://github.com/soc/scala-java-time/blob/master/shared/src/main/scala/org/threeten/bp/format/DateTimeFormatter.scala |
I've seen these classes. But, DateTimeFormatterBuilder imports ZoneId (not implemented in this repo) which imports ZoneRulesProvider (not implemented in this repo) and java.util.TimeZone (not implemented in scala-js ?), and so on... |
@njouanin
So there is no need to have any zone/offset implementation for this piece of functionality. The threeten implementation works for the valid inputs I tested on both JVM and JS. Do you have any inputs which should work, but don't? |
I've tried your threeten implementation, but I think it doesn't fit my needs. I'm writing a application with a Scala(Play) backend and a ScalaJS frontend. Both communicate through Ajax calls and I use circe on the frontend to parse json replies from the backend. Json objects are mapped to case classes which code is shared between the frontend and server code. Some of them contain |
I can/will do this for now. |
Ok, let me know if you hit any issues!
No, as the implementation is intended to work on the JVM, on JS and on Native. Adding it to scala-js would be confusing to two thirds of the potential users. |
Anyway, isn't there time to change the package names, or add a wrapper for the original packages? |
See https://github.com/soc/scala-java-time/issues/22. The idea is to make sure that we can run the tests on all platforms before the rename, because as soon as we change the package to
I think shipping the aliases with the package would make sense, but I'm not sure how that would interact with the |
Ok. Something similar to https://github.com/zoepepper/scalajs-jsjoda/tree/master/java-time-drop-in/src/main/scala/java But it looks like a lot of work... |
@mkotsbak I think it could be automated quite easily with a bit of reflection or REPL :power-mode scripting. |
@cquiroz You appear to be still be putting work into Simon's implementation. Could you weigh in whether you are interested in taking ownership of it or whether people should look only to this repository going forward (assuming no one else comes along that wants to pick up code)? A PR to the website should probably be made either to indicate its new location or to indicate its inactive state. |
@vossad01 I pretend to continue Simon's work on my own fork, there is not too much left to do, it would be a pity to waste it given how much is done on |
Hi, I've written some (a lot actually) classes in my own fork. May be you can have a look at it so we don't work in double. |
@njouanin There is no reason why there can't be multiple |
Sorry, I didn't read your repo name correctly. |
What's the state of this project? Is it maintained? |
It's maintained, but it is not contributed to. Feel free to send PRs, and we'll review them. |
The java.time.Instant is marked as implemented, even though the parse method is not implemented. Is there another issue for the parse methods support, which I can follow? Didn't find anything except the one which is closed #10. |
Parse methods are not implemented in any of the classes yet as that requires some sort of locale support. Probably you would be more interested in @cquiroz 's |
@alonsodomin thanks |
Thank you contributors. |
What is the status of this PR/ library? It seems there has been no activity whatsoever since at least a year. I am interested in |
Take a look at https://github.com/cquiroz/scala-java-time instead of this library. Nobody contributes to scalajs-java-time anymore. |
I suggest to clarify the status of this project in its README |
Thanks for the library; It would be great to address the missing |
This is now done. I will close this issue now, since I don't think anything more will happen here. |
java.time.Clock
java.time.Duration
java.time.Instant
java.time.LocalDate
java.time.LocalDateTime
java.time.LocalTime
java.time.MonthDay
java.time.OffsetDateTime
java.time.OffsetTime
java.time.Period
java.time.Year
java.time.YearMonth
java.time.ZonedDateTime
java.time.ZoneId
java.time.ZoneOffset
java.time.DayOfWeek
java.time.Month
java.time.DateTimeException
java.time.chrono.ChronoLocalDate
java.time.chrono.ChronoLocalDateTime<D extends ChronoLocalDate>
java.time.chrono.Chronology
java.time.chrono.ChronoPeriod
java.time.chrono.ChronoZonedDateTime<D extends ChronoLocalDate>
java.time.chrono.Era
java.time.chrono.AbstractChronology
java.time.chrono.HijrahChronology
java.time.chrono.HijrahDate
java.time.chrono.IsoChronology
java.time.chrono.JapaneseChronology
java.time.chrono.JapaneseDate
java.time.chrono.JapaneseEra
java.time.chrono.MinguoChronology
java.time.chrono.MinguoDate
java.time.chrono.ThaiBuddhistChronology
java.time.chrono.ThaiBuddhistDate
java.time.chrono.HijrahEra
java.time.chrono.IsoEra
java.time.chrono.MinguoEra
java.time.chrono.ThaiBuddhistEra
java.time.format.DateTimeFormatter
java.time.format.DateTimeFormatterBuilder
java.time.format.DecimalStyle
java.time.format.FormatStyle
java.time.format.ResolverStyle
java.time.format.SignStyle
java.time.format.TextStyle
java.time.format.DateTimeParseException
java.time.temporal.Temporal
java.time.temporal.TemporalAccessor
java.time.temporal.TemporalAdjuster
java.time.temporal.TemporalAmount
java.time.temporal.TemporalField
java.time.temporal.TemporalQuery<R>
java.time.temporal.TemporalUnit
java.time.temporal.IsoFields
java.time.temporal.JulianFields
java.time.temporal.TemporalAdjusters
java.time.temporal.TemporalQueries
java.time.temporal.ValueRange
java.time.temporal.WeekFields
java.time.temporal.ChronoField
java.time.temporal.ChronoUnit
java.time.temporal.UnsupportedTemporalTypeException
java.time.zone.ZoneOffsetTransition
java.time.zone.ZoneOffsetTransitionRule
java.time.zone.ZoneRules
java.time.zone.ZoneRulesProvider
java.time.zone.ZoneOffsetTransitionRule.TimeDefinition
java.time.zone.ZoneRulesException
The text was updated successfully, but these errors were encountered: