I have a gannt chart working but no matter what I try I can’t get the weekends to be hidden.
I did have it so that the weekend class was set to disp;ay: none; but I didn’t think that was a good idea.
Note the console.log('ignore time')
in the function, you will notice that it will never be printed to the console.
Does anyone have any ideas?
gantt.config.scale_unit = "month";
gantt.config.step = 1;
gantt.config.date_scale = "%F, %Y";
gantt.config.min_column_width = 50;
gantt.config.scale_height = 90;
gantt.config.work_time = true; //removes non-working time from calculations
gantt.skip_off_time = true; //hides non-working time in the chart
gantt.config.readonly = true;
var weekScaleTemplate = function(date){
var dateToStr = gantt.date.date_to_str("%d %F");
var endDate = gantt.date.add(gantt.date.add(date, 1, "week"), -1, "day");
return dateToStr(date) + " - " + dateToStr(endDate);
};
gantt.config.subscales = [
{unit:"week", step:1, template:weekScaleTemplate},
{unit:"day", step:1, date:"%D %d" }
];
// 0 refers to Sunday, 6 - to Saturday
gantt.ignore_time = function(date){
console.log('ignore time')
if(date.getDay() == 0 || date.getDay() == 6)
return true;
};
$('#gannt').dhx_gantt({
data: demo_tasks
});