为了让用户注意特定的时间段,您可以突出显示它们。
模板是一个函数,它遍历所有日期并将指定的 CSS 类应用于相关单元格。

例如,您可以突出显示周末以直观地将比例划分为周:
gantt.templates.scale_cell_class = function(date){
if(date.getDay()==0||date.getDay()==6){
return "weekend";
}
};
gantt.templates.timeline_cell_class = function(task,date){
if(date.getDay()==0||date.getDay()==6){
return "weekend" ;
}
};
gantt.init("gantt_here");
请注意,在使用工作时间计算时,您可以使用isWorkTime而不是硬编码值:
gantt.config.work_time = true; gantt.templates.