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

SCJS Java 1.7 does not have TimeZone #5

Open
chrismurrph opened this issue Aug 30, 2015 · 3 comments
Open

SCJS Java 1.7 does not have TimeZone #5

chrismurrph opened this issue Aug 30, 2015 · 3 comments

Comments

@chrismurrph
Copy link

[info] Fast optimizing C:\dev\v3\wiring\js\target\scala-2.11\client-fastopt.js
[error] Referring to non-existent class ju_TimeZone$
[error]   called from Lorg_joda_time_DateTimeZone$.getDefault__Lorg_joda_time_DateTimeZone
[error]   called from Lorg_joda_time_DateTimeZone$.forID__T__Lorg_joda_time_DateTimeZone
[error]   called from Lcom_seasoft_common_utils_SeaLogger$.init___

No java.util.TimeZone in SCJS was why I started using SodaTime. But Joda requires it so I'm back to square one. I read the other issue where it talked about Locale not being able to be supported. I would argue that TimeZone is important from the point of view of all clients being able to view the time at the server, which some applications may require. If you like I could investigate how Clojurescript overcomes some of these problems...

@mdedetrich
Copy link
Owner

That would help, the relevant issue is here #2. Locale appears to be a bit weird in Javascript, according to scala-js/scala-js#1773

Currently doing some work on putting Array util methods in Scala.js, so didn't have time for Locale

@chrismurrph
Copy link
Author

The equivalent of SodaTime in ClojureScript is https://github.com/andrewmcveigh/cljs-time. clj-time (without the 's', so is on the JVM) wraps JodaTime, so cljs-time (being clj-time inspired) does too.
You can only guess at the TimeZone in JavaScript (https://www.redfin.com/devblog/2007/08/getting_the_time_zone_from_a_web_browser.html). Arguably guessing is better than nothing, however the author of cljs-time does not buy this argument, and so cljs-time does not support TimeZone.

So not having TimeZone capabilities on the browser is expected, and I'm going to close this.

@mdedetrich
Copy link
Owner

I know that Moment allows you to get the timezone from the browser, so I will have a look at their implementation before completely closing this off. I know you can get the offset.

Thing is, that Joda Time (and hence Soda Time), do have a concept of timezone, but it may just be that the server will set the timezone for the client, rather than trying to auto detect it. Will have a look into this myself

@chrismurrph chrismurrph reopened this Sep 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants