For example,the start date is 2019-4-1 ,end date is 2019-4-3,
I want change the timeline ,make it draw from 2019-4-1 to 2019-4-3, not 2019-4-2
how can I do?
If you want to change the time scale, what I do is I do it in the background, one day later.
If you don’t understand, use the netease youdao dictionary
Hi @xcchsm !
If you want to set start and end dates, you need to use gantt.config.start_date and gantt.config.end_date:
https://docs.dhtmlx.com/gantt/api__gantt_start_date_config.html
https://docs.dhtmlx.com/gantt/api__gantt_end_date_config.html
Here is the example can help to you
gantt.config.start_date = new Date(2019, 04, 01);
gantt.config.end_date = new Date(2019, 04, 03);
Also you can change the displayed range dynamically. Look here:
https://docs.dhtmlx.com/gantt/desktop__configuring_time_scale.html#dynamic_scale
Hi,I mean the task line
the end_date is 2018-4-1, I want change the task line , add one day.
Hi @xcchsm!
In this case 2018-4-1 displayed in the grid means 2018-04-01 00:00:00 - meaning that the tasks spans whole 31st of March, and ends by the 1st of April.
I understand why this is confusing, but currently there is no good way to switch the display logic of end dates
As a simple workaround, you can subtract one minute from the end_date of each of your tasks, that way you’ll task would end at 2018-03-31 23:59:00
and will be shown in gantt as expected.
It can be done by using gantt.date.add() metod with onBeforeTaskUpdate event.
https://docs.dhtmlx.com/gantt/desktop__date_operations.html#addingsubtractingatimeintervaltofromadate
https://docs.dhtmlx.com/gantt/api__gantt_onbeforetaskupdate_event.html
Here is the sample with changed tasks’ timeline:
http://snippet.dhtmlx.com/9402e4382