We have multiple views using different scales. We have Month/Day, Month/Week, Year/Month, etc.
Only one set of views has a Day scale, and I want to apply a “weekend” class only if my config.scales
includes a Day scale.
Is there a good way to apply this once instead of something like this?
gantt.templates.timeline_cell_class = function(_, date: Date) {
const hasDayScale = (gantt.config as any).scales.some(
(s: Scale) => s.unit === ScaleUnit.DAY
);
if (hasDayScale && (date.getDay() == 0 || date.getDay() == 6)) {
return 'my_task_cell--weekend';
}
return '';
};