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

Conversation

nbowditch
Copy link
Contributor

Explanation

In TimeStep's setMoment function, the TimeStep accepts a new moment instance, and then uses it to clone new values for its current, _start, and _end values. The problem is that if the new moment instance has a different locale, these values do not get the new locale since they were cloned from the old instances.

Changes

The fix is to instead pass the new moment instance the date values of the variables. This will create new moment instances for the variables that have the new locale.

Note: this bug won't be apparent in examples that set window's moment, as this is the instance originally required by the TimeStep, so locale changes would, in that case, be reflected.

…ce with the same locale as the TimeStep's moment instance
@mojoaxel
Copy link
Member

mojoaxel commented Aug 9, 2016

Makes sense to me!
@nbowditch Thanks!

@mojoaxel mojoaxel merged commit d951959 into visjs:develop Aug 9, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants