-
Notifications
You must be signed in to change notification settings - Fork 23
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
Wrapper for use in shared JS/JVM projects? #29
Comments
Hi, @migo! I have an article with a more in-depth look at the problem: http://pavkin.ru/cross-platform-polymorphic-datetime-values-in-scala-with-type-classes/ |
Ok, cool. That sounds interesting. |
I have read your article and looked at the library. It's cool that it works like that. |
Because you can't run javascript on the JVM. All the moment-js power is useless at the backend.
It is possible, see for example |
I think that's not a problem in principle. If you implement java.time in the frontend using moment.js, you do not need to implement anything in the backend, because you can use java.time directly there. That's the approach taken by https://github.com/zoepepper/scalajs-jsjoda, and it works. Just that many methods of java.time are not yet implemented correctly there and timezone support is mostly missing. |
Wouldn't it be cool if the facade could be used in cross projects and not just in Scala.JS only projects?
We would need some kind of wrapper for this purpose. Either a wrapper for Moment.js using java.time in the JVM or a wrapper of java.time (or joda time or whatever) using Moment.js in the JS part.
There is already https://github.com/zoepepper/scalajs-jsjoda and https://github.com/cquiroz/scala-java-time for this purpose, but both have some problems at the moment. The first one is very incomplete and the second one has very limited support for Locales and time zones.
Moment.js, in contrast, seems to be quite complete.
The text was updated successfully, but these errors were encountered: