Hi,
“timeline_cell_class” template receives 3 arguments (evs, date, section). docs.dhtmlx.com/scheduler/api__s … plate.html
If these is no events in the cell, the first argument is undefined.
The following JavaScript sets the css based on the day of week
[code]
<script type="text/javascript">
function switchStyle() {
// generates day-specific style sheet name (e.g. SG360Day1.css)
// and replaces placeholder in link whose id is "grid_css"
var styleElement = document.getElementById("grid_css");
var date = new Date();
var dayNo = date.getDay();
var newStyleString = "SG360Day" + dayNo.toString() + ".css";
styleElement.href = newStyleString;
//alert("Style: " + newStyleString);
};
switchStyle();
</script>[/code]
The CSS files look like this (the variables @weekday and @weekend are defined in the imported .less file - if you don’t want to use less, replace the variables with a valid color). The example below is for day 0 (Sunday)
This colors the 1st and 7th elements the color defined in @weekend and the rest, the color defined in @weekday. (Using 7n-x was the only way I could get colors to cycle after 7 days. Not sure if there’s an easier way, but it works for me.)