deadline is one field of gantt.config.columns ,after I click “+” to add task,it work wrong.
error:
VM3246:3 Uncaught TypeError: Cannot read property ‘getFullYear’ of undefined
at eval (eval at date_to_str (dhtmlxgantt611.js:11), :3:16)
at dhtmlxgantt611.js:11
at Object.gantt.templates.tooltip_text (custom.js:345)
error source code:
var deadline = formatFunc(task.deadline);
Hello,
That error is not a bug, it is related to the configuration.
First, you need to check that a task has the deadline date:
if (task.deadline) {
var deadline = formatFunc(task.deadline);
return task.text + formatFunc(start) + "-" + deadline ;
}
else return '';
Then, if the task really has the deadline property, you need to make sure that there is the date object, not just a string with the date. You can do that by parsing the date when loading a task so that it can be used in other functions like additional layers: