Gantt scroll to date

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

Hello Molven,
I couldn’t reproduce the issue in the following snippet:
https://snippet.dhtmlx.com/u5rvsv5x

Most likely, the dayjs library doesn’t return the proper Date object. If the date is not valid, the showDate is not expected to work.

If that doesn’t help you, probably, the issue is related to the Gantt configuration, but it is hard to suggest what might be wrong as I don’t see your code.
Please add your configuration to the following snippet and make sure that the issue is reproduced there:

Then, click on the Save button and send me the link.
Or send me a ready demo with all the necessary JavaScript and CSS files so that I can reproduce the issue locally.