var conf = {
dateRange: [
new Date('2017-01-01'),
new Date('2018-01-01'),
],
data: [
// ...
]
};
var t = new Zeitline.Timeline(conf);
t.render();
buttonNext.addEventListener('click', (e) => {
var diff = conf.dateRange[1] - conf.dateRange[0];
conf.dateRange[0] -= -diff;
conf.dateRange[1] -= -diff;
t.update(conf);
}, false);
buttonPrev.addEventListener('click', (e) => {
var diff = conf.dateRange[1] - conf.dateRange[0];
conf.dateRange[0] -= diff;
conf.dateRange[1] -= diff;
t.update(conf);
}, false);