almende / vis

⚠️ This project is not maintained anymore! Please go to https://github.com/visjs
7.86k stars 1.48k forks source link

Timeline moveTo it's not centering near the end or the beginning #3482

Open JoseCunha opened 6 years ago

JoseCunha commented 6 years ago

Hi,

I've already reported as a comment in a previous issue an issue related to the moveTo method. Don't know if it's the correct place to ask about this issue again, so apologies for that if it's not the case.

I have the following case for VISJS Timeline version 4.20.1 tested in Chrome Version 60.0.3112.113, Windows 10 64bit.

I created the timeline like this: var timeline = new vis.Timeline(container); I do some operations to obtain the options and later on I add them to the Timeline:

var options = {max:new Date(2018, 1, 1),min:new Date(1980,1,1), zoomMax:315360000000000, zoomMin:10, zoomable:true} timeline.setOptions(options);

I added several items to near the begin (min) and the end (max) of the timeline.

After that I use the method moveTo to move and center to a specific date. In the majority of the cases it works as expected, but when it approaches the limits (max or min) it doesn't center and sometimes the callback doesn't work.

In a small example I present to you this case, but it's only as an example.: Timeline_moveTo_example.zip

Thank you in advance. Best regards, José Cunha

Siedlerchr commented 6 years ago

I had a similar problem. My workaround was to use moment.js lib and add +10/-10 minutes in the moveTo Arguments