Skip to content
This repository has been archived by the owner on Jul 29, 2019. It is now read-only.

Timeline displayed in UTC #1096

Closed
daniel-pfeiffer opened this issue Jul 16, 2015 · 5 comments
Closed

Timeline displayed in UTC #1096

daniel-pfeiffer opened this issue Jul 16, 2015 · 5 comments

Comments

@daniel-pfeiffer
Copy link

If I add items with ISO UTC start and end (i.e. a T between date and time) they get picked up correctly. However, since my PC is running in European summer time (UTC+2) they are displayed off by 2 hours which is startling.
In order for all users of my timeline to have the same view, it would be great to have an option to display labels and current time in UTC.
I have looked at moment.js, and it looks like everything needed is there, but I'm not sure of all the places where this would be plugged into vis.js. Likely all places where you call moment(...) need to be changed to optionally call moment.utc(...). Or else, after that, you optionally call result.utc().

@Fice
Copy link
Contributor

Fice commented Jul 16, 2015

I've just made a PR that would address that issue: #1098. This allows yout to pass a custom function as the format option. Displaying UTC was exactly my use case (as well as a 'x days ago' label on another timeline instance).

@daniel-pfeiffer
Copy link
Author

Thanks! But I think that would not get it quite right. It's not enough to modify the labels. The lines separating days would need to move accordingly. The easiest way for it all to fall in place would probably be to fetch "now" as UTC rather than localtime.

@josdejong
Copy link
Contributor

Duplicate of #24.

Support for time zones will be available in the first next release (see #24 (comment)).

@daniel-pfeiffer
Copy link
Author

Upgraded to 4.7.0 and the new option moment looks like it's working great. Thumbs up to Almende!

@josdejong
Copy link
Contributor

Thanks :)

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

No branches or pull requests

3 participants