Change color of Column of each Date

Hello
I want to change the color of the date of each column in the timeline’s time scale. same as timeline_cell_class.
https://prnt.sc/tkzuxo

I used gantt.templates.scale_cell_class but the color did not change. I followed the following web page instructions link

is there anything else needed?

Hi,

It’s hard to tell without seeing your code and css,
but you can try setting css template directly in the ‘scales’ config:

var weekEndClass = function(date){
  if(date.getDay() === 6 || date.getDay() === 0){
    return "week-end";
  }
  return "";
};

gantt.config.scales = [
  {unit:"month", step: 1, format: "%M"},
  {unit:"day", step: 1, format: "%D", css:function(date){
     return weekEndClass(date);
  }},
  {unit:"day", step: 1, format: "%d", css:function(date){
     return weekEndClass(date);
  }}
];

css:

  .week-end{
    background: silver; 
    color: white !important;
  }

demo: http://snippet.dhtmlx.com/5/817a40032

1 Like