Open Gantt with visualization in SYSDATE

Hi, I need to open my gantt in today. For example, if today is the 01.01.2016 when I open the gantt the grid start in this date and not in other date.

Hello,

You can set start_date config:
gantt.config.start_date = new Date();

docs.dhtmlx.com/gantt/api__gantt … onfig.html

I use it, but go only if I put start_date and end_date. The second problem don’t visualize the task in the other date. I want when I open the gantt that the first date visualize is the SYSDATE, but with the possibility I can see all the task.

Hello.

In case if you want to show all the dates, but scroll to some specific date, you could use scrollTo function.
See article: docs.dhtmlx.com/gantt/api__gantt_scrollto.html
In this case you could use only “left” argument. To get date position, you could use posFromDate function.
See article: docs.dhtmlx.com/gantt/api__gantt … mdate.html
You should get something like following:

gantt.scrollTo(gantt.posFromDate(new Date()), null);

For example: docs.dhtmlx.com/gantt/snippet/4c169c45

Ah perferct thank you, but i have a problem. If I put this code gantt.scrollTo(gantt.posFromDate(gantt.date.day_start(new Date()))); in my gantt the day is correct but the month is wrong of 1 month.

For example: today is the 21.12.2016 but the gantt date visualize is 21.11.2016

Can you share the updated snippet where the issue can be checked? The above one works correctly while checking from our side, so it must be somehow related to the custom logic or custom configuration in your case.

This is my code, near the “/////…” you can see the cod I add.

[code][/code]

Hi,

Please be sure that you have some tasks at the December. scrollTo method will scroll the Gantt view to the target date, but it will not create a new date sections if they were not initially rendered. So you need to have the range of dates to be defined, to force rendering of December dates, or have some task in December ( in such case range can be auto-calculated )

docs.dhtmlx.com/gantt/snippet/99593706