getFullYear problem

I downloaded the pro gantt control and am trying to do a proof of concept. If I add using the very top plus button on the gantt, everything is fine. If I use a plus button in the middle of the schedule, I get an error in javascript “date.getFullYear is not a function”. What am I doing wrong?

Hello Jon,
It should be related to Gantt configuration.
One of the reasons why it happens is that the xml_date template returns wrong data. It should return a date object, but it returns the string:
https://snippet.dhtmlx.com/02e63730d
To fix it, you need to return a date object or a command that will convert a string to a date object:

return new Date(date)

or

return gantt.date.str_to_date("%d-%m-%Y %H:%i")(date);

Here is the updated snippet:
http://snippet.dhtmlx.com/d28459cc6

However, it might happen because of other reasons. I don’t see your code, so I cannot tell you what is the cause.

Please, reproduce the issue in the snippet, then click on the “Share” button and send me the link:
https://snippet.dhtmlx.com/3a7e741de
Or send me an HTML file with all the necessary Javascript and CSS files.