fix: Correctly set timeline's window bounds on page load. (Plus set the

end to the date+1 to see the whole day).
pull/29/head
Sami Mokaddem 2017-12-13 09:03:52 +01:00
parent 032f671d14
commit 795dae2323
1 changed files with 4 additions and 2 deletions

View File

@ -443,11 +443,13 @@ function updateTimeline() {
items = new vis.DataSet(items);
if (timeline === undefined) { // create timeline
timeline = new vis.Timeline(document.getElementById('timeline'));
timeline.setOptions(timeline_option);
}
var dateEndExtended = new Date(dateEnd).setDate(dateEnd.getDate()+1); // dateEnd+1
timeline_option.start = dateStart;
timeline_option.end = dateEndExtended;
timeline.setOptions(timeline_option);
timeline.setGroups(groups);
timeline.setItems(items);
timeline.setWindow(dateStart, dateEnd);
});
}