There are several things you need to change in the snippet to make it work.
If you are passing the task object in the
updateTask method, you need to include all the necessary parameters as Gantt would expect them. There are mandatory parameters:
duration. Without them, the task won’t be correctly updated.
There are also additional task properties that related to links:
$target. Even if a task doesn’t have links, it should have these properties:
It should work correctly without these properties, but the auto-scheduling feature expects tasks to have links or at least these properties.
Also, you pass the date in a string format. You need to manually convert it to the Date object.
If you do only that, the task will be moved to a new position:
But as the link IDs are not listed in the
$target parameters, they are not repainted. In that case, Gantt will reflect the changes only after the next repainting.
So, you need to include the link IDs there, then everything will work as expected: