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

UTC support #38

Open
lrozenblyum opened this issue Apr 8, 2016 · 4 comments
Open

UTC support #38

lrozenblyum opened this issue Apr 8, 2016 · 4 comments
Labels

Comments

@lrozenblyum
Copy link
Contributor

Reproduced in 0.9.3 not in 0.9.1
While it's nice that Gantt supports custom timezones now, it's an issue it doesn't support UTC anymore.
gantt.setTimeZone( TimeZone.getTimeZone("UTC") ); will throw an exception

It is possible to avoid dependency on TimeZoneConstants.properties at all?
java has https://docs.oracle.com/javase/8/docs/api/java/util/TimeZone.html#getAvailableIDs--
we could rely always on.
Thanks.

Corresponding part of stack trace:

Caused by: java.lang.IllegalArgumentException: Time zone UTC not found in TimeZoneConstants.properties
at org.tltv.gantt.Gantt.getTimeZoneJson(Gantt.java:899)
at org.tltv.gantt.Gantt.updateTimezoneOffsets(Gantt.java:794)
at org.tltv.gantt.Gantt.updateTimelineStartTimeDetails(Gantt.java:781)
at org.tltv.gantt.Gantt.setStartDate(Gantt.java:188)
...
....
at com.vaadin.ui.UI.accessSynchronously(UI.java:1381)
at com.vaadin.ui.UI$3.run(UI.java:1447)

@tltv
Copy link
Owner

tltv commented Apr 8, 2016

Unfortunately TimeZoneConstants.properties doesn't support UTC by default.

Dependency is there to produce GWT friendly json for timezone and send it to client for further usage. You can override TimeZoneConstants completely and populate timezone json for any zone id by your self.
That you can do by overriding Gantt.getTimeZoneJson(String id). Returned json has to respect the same format that is used in TimeZonteConstants.properties file.

You can also change the properties file by overriding createTimeZonePropertiesInputStream( String propertiesFileName).

Dependency to TimeZoneConstants class will still stay, but TimeZoneConstants.properties file dependency can be removed by overriding one of those methods.

@tltv tltv added the question label Sep 16, 2016
@lrozenblyum
Copy link
Contributor Author

thank you very much tor the explanation!
It's nice that the TimeZoneConstants.properties is now part of the Gantt itself, so it's more obvious for non-GWT-gurus what's going on.

@dyorgio
Copy link

dyorgio commented Feb 9, 2018

Hi @lrozenblyum , do you have example code of Gantt.getTimeZoneJson(String id) override to share with us 👼 ?

@lrozenblyum
Copy link
Contributor Author

Hi @dyorgio. Unfortunately no, we haven't override this yet.
At the moment we disabled possibility to work in UTC with the Gantt because our usage scenarios allowed to do that based on real customer experience.
For sure it's not an elegant solution...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants