export const useChangeTimeline = ({ gantt, forecastPeriod, date, endDate }: ChangeTimelinePayload) => {
useEffect(() => {
if (gantt.$container) {
const dateToScroll = dayjs().subtract(7, 'day').toDate();
gantt.config.start_date = date.toDate();
gantt.config.end_date = endDate
? endDate.toDate()
: calculateForecastDay({ startDate: date, forecastPeriod }).toDate();
gantt.render();
gantt.showDate(dateToScroll);
}
}, [gantt.$container, date, forecastPeriod, endDate]);
};
I dynamically change the Gantt interval and when I change it I want to scroll to the day that is a week ago from today, but it does not scroll
@ramil @Maksim_Lakatkou