End date - Weekend issue


I am using a evaluation version of Gantt chart and having an issue when the end_date is a weekend date.
My column config :

gantt.config.columns = [
{name:“text”, label:“Task name”, width:"", tree:true },
{name:“start_time”, label:“Start time”, template:function(obj){
return gantt.templates.date_grid(obj.start_date);
}, align: “center”, width:80 },
{name:“end_time”, label:“End time”, template:function(obj){
var end_date = gantt.calculateEndDate(obj.start_date, obj.duration, “day”);
var day = end_date.getDay();
if (day == 6) end_date.setDate(end_date.getDate() + 2);
if (day == 0) end_date.setDate(end_date.getDate() + 1);
return gantt.templates.date_grid(end_date);
}, align: “center”, width:80 },
{name:“duration”, label:“Task name”, width:"
", tree:true },


	gantt.config.auto_scheduling = true;
	gantt.config.auto_scheduling_strict = true;
	gantt.config.auto_scheduling_initial = false;
	gantt.config.work_time = true;
	gantt.config.correct_work_time = true;

for eg : if I move end date of Task 1 by one day. Then I would like the dependent tasks also to move by 1 day. That works fine. But if the dependent end_date is a weekend then I would like the end_date to be the following monday.
My Task1 dates - 2015-05-05 2015-05-05 duration : 0 days
Task 2 dates : 2016-06-13 2016-06-17 duration : 4 days

I change my Task1 end date to 2015-05-06
then my dependent Task2’s dates become 2016-06-14 2016-06-21

Task2’s end date should have been 2016-06-20 but not sure why it comes out as 2016-06-21.
Could you pls. help …am I missing something in setting of work_time properties ?


In your case end_date is 21/06/2016. So it means that your event finishes June 21th at 00:00 and covers June 20th and doesn’t cover June 21th. If you want to display June 20th you should set end date “2016-04-20 23:59:59”, but correct case is to use “2016-04-21” or “2016-04-21 00:00”.
If it necessary for you, you could correct event dates in onTaskLoading handler.
docs.dhtmlx.com/gantt/api__gantt … event.html