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

timezone options break the view #193

Closed
lplip opened this issue Nov 17, 2019 · 2 comments · Fixed by #234
Closed

timezone options break the view #193

lplip opened this issue Nov 17, 2019 · 2 comments · Fixed by #234
Labels
bug Something isn't working released

Comments

@lplip
Copy link

lplip commented Nov 17, 2019

OS: windows 10

browser: firefox 70.0.1 / chrome 78.0.3904.97

version of vis.js :

Hi, all

we use VisJS in our project to display a timeline representation on a data.
recently we update to the last version (6.2.3) and we face with "view jumping" problem
when the user is scrolling horizontally.
I try to find any information or something that can help on the web but without luck.
what I do find is that when I remove the timezone settings (we need to use UTC)
var options = { moment: function(date) { return vis.moment(date).utc(); } };
the problem is gone.
we found that this related to the moment option by eliminating feathers from this component.
and don't have more clue about how to fix it.
any help will be welcome

thanks!

gif

@yotamberk yotamberk added the bug Something isn't working label Nov 18, 2019
@lplip
Copy link
Author

lplip commented Dec 1, 2019

UPDATE:
I don't 100% sure but, at TimeStep.js line 123 start function
after the roundToMinor sometimes the this.current changed to local time.
looks like reference problem or side-effect some were.
currently to fix it I FORCE set this.current to the correct settings by calling
this.options.moment again.
change to start function

from:
start() { this.current = this._start.clone(); this.roundToMinor();}

To:
start() { this.current = this._start.clone(); this.roundToMinor(); // force to use user configuration(options object). this.current = this.options.moment(this.current.valueOf()); }

yotamberk added a commit that referenced this issue Dec 28, 2019
* fix: issue 193

* fix: test
@vis-bot
Copy link
Collaborator

vis-bot commented Dec 28, 2019

🎉 This issue has been resolved in version 6.3.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants