I’m trying to update my baselines as follows
updateBaselines(tasks, activities) {
for (let i = 0; i < activities.length; i++) {
var act = tasks.find(x => x.activityId === activities[i].activityId);
if (act !== undefined) {
var activity = gantt.getTask(act.id);
activity.planned_start = gantt.date.parseDate(new Date(activities[i].plannedStartDate), "xml_date");
//activities[i].plannedStartDate ="2018-02-15T08:00:00+00:00" string value
//same scenario with this planned_end value.
activity.planned_end = gantt.date.parseDate(new Date(activities[i].plannedEndDate), "xml_date");
//the dates are correct when checking activity
gantt.updateTask(activity.id);
//after updateTask is called both planned_start and planned_end are set to date objects of
///Wed Dec 31 1969 16:00:00 GMT-0800 (Pacific Standard Time) {}
}
}
gantt.refreshData();
}
Why are the dates reverting toa date of
Wed Dec 31 1969 16:00:00 GMT-0800 (Pacific Standard Time) {}
after calling updateTask?
THis only happens when I update a task, not create one.