converts a date object to a date string. Used to send data back to the server
date | Date | the date which needs formatting |
var dateToStr = gantt.date.date_to_str("%Y-%m-%d %H:%i");
gantt.templates.format_date = function(date){
return dateToStr (date);
};
Check Date Format Specification.
You can use ISO date format in Gantt. For this, you need to redefine functions that parse and serialize dates in Gantt:
gantt.templates.parse_date = function(date) {
return new Date(date);
};
gantt.templates.format_date = function(date) {
return date.toISOString();
};