specifies the CSS class that will be applied to the cells of the timeline area
item | object | the task object assigned to the row |
date | Date | the date of a cell |
<style>
.weekend{ background: #f4f7f4 !important;}
</style>
gantt.templates.task_cell_class = function(task,date){
if(date.getDay()==0||date.getDay()==6){
return "weekend";
}
};
Note that while using work time calculations, you can use isWorkTime instead of hardcoded values:
gantt.config.work_time = true;
gantt.templates.task_cell_class = function(task,date){
if(!gantt.isWorkTime({task:task, date:date}))
return "weekend";
};