Parent's start_date and end_date are getting overwritten by child tasks, even when set

In our gantt, whenever we create subtasks to a parent task, the parent will be shown in the calendar with the child’s start_date and end_date, even when the parent’s dates have been set.

I have noticed this happens right after parse() is called, so I checked all of our template functions to see if any of them was causing it to happen, but this didn’t seem to be the case…

I then stepped through the gantt.parse() call with the debugger and, about a third of the way through, I saw the values of the start_date and end_date variables changing from the correct ones to those of the child tasks, with no immediate apparent cause as to why…

We are using "dhtmlx-gantt-pro": "^6.1.6", and this is the structure of the tasks in our In it you can see the correct values on startDate and endDate, and the values of start_date and end_date. Before parse():

  "name": "campaign 3",
  "duration": 1,
  "timezone": {
    "id": 315,
    "name": "Europe/Berlin"
  "planningMatch": false,
  "startDate": "2019-09-30T22:00:00Z",
  "endDate": "2019-10-15T21:59:59Z",
  "start_date": "2019-10-01T22:00:00.000Z",
  "end_date": "2019-10-02T21:59:59.000Z",
  "id": 372,
  "templateId": 0,
  "hasChildren": true,
  "hasJobs": false,
  "hasChildrenWhichMatch": false,
  "unscheduled": false,
  "type": "project",
  "progress": 0,
  "$no_start": true,
  "$no_end": true,
  "$rendered_type": "project",
  "$source": [],
  "$target": [],
  "$rendered_parent": 0,
  "$level": 0,
  "parent": 0,
  "$open": false,
  "$index": 0

I hope this information is enough to help identify the issue, but I’d be happy to supply more details.

Has anyone experienced a similar issue?

Ok, so it seems the problem is that we are using the ‘gantt.config.project’ type for the parent, but only when it has children.

As per the documentation, project task is a task that starts, when its earliest child task starts, and ends, when its latest child ends.

So when I create the task and it still has no children, it is loaded in the gantt as a task, and I can see the full range of its start and end date on the scale. However, as soon as the first child is added, the parent’s type will change to project, which will make it take the dates of its start and end date.