Can I change the task timeline ?


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:



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:



Hi,I mean the task line%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_20190415091742

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.
Here is the sample with changed tasks’ timeline: