timeline_cell_class

定义应用于 timeline 区域单元格的 CSS 类

itemTask | object与行关联的任务或资源对象
dateDate单元格对应的具体日期

Example

<style>
.weekend{ background: #f4f7f4 !important;}
</style>
 
gantt.templates.timeline_cell_class = function(task,date){
    if(date.getDay()==0||date.getDay()==6){
        return "weekend";
    }
};

Related samples

Details

在处理工作时间计算时,推荐使用 isWorkTime 而非固定值:

gantt.config.work_time = true;
 
gantt.templates.timeline_cell_class = function(task,date){
    if(!gantt.isWorkTime({task:task, date:date}))
        return "weekend";
};
See also
Back to top