I’ve rendered the Gantt in week scale format.
My use case is to move the week both forward and backward with the button control.
To brief out, I would like to have next and previous button, on clicking them the week should move forward and backward respectively.
Could someone guide me on implementing this in Gantt?
The code of the scroll button may look like the following:
function scrollWeekForward(){
// Get scroll state
currentScrollState = gantt.getScrollState().x;
// Calculate date from it
currentScrollDate = gantt.dateFromPos(currentScrollState);
// Add the 1 week to the previous date
newScrollDate = gantt.date.add(currentScrollDate, 1, 'week');
// Calculate the position of the newScrollDate
newScrollState= gantt.posFromDate(newScrollDate);
// Scroll to the new date
gantt.scrollTo(newScrollState)
}