We want to give none-working elements custom CSS. We can override b-sch-resourcenonworkingtime
. However if we set cls field to some other custom class (b-sch-resourcenonworkingtime-maintenance
), elements will still be styled by b-sch-resourcenonworkingtime
. Eventually we will want to give each element its custom CSS.
adding cls on backend in python
calendars.append({
"id": str(dt['wks_id']),
"name": str(dt['wks_id']),
"unspecifiedTimeIsWorking": True,
"cls": "b-sch-resourcenonworkingtime-maintenance",
"intervals": [{
"name": dt['reason'],
"startDate": dt['start_date'].isoformat(),
"endDate": (dt['start_date'] + timedelta(hours = dt['duration'])).isoformat(),
"isWorking": False,
"cls": "b-sch-resourcenonworkingtime-maintenance",
}]
})
adding calendar on frontend
scheduler.project.calendarManagerStore.add(data['calendars']);
css
.b-sch-resourcenonworkingtime, .b-sch-resourcenonworkingtime-maintenance {
background-color: #0000ff;
}
.b-sch-resourcenonworkingtime-maintenance {
background-color: #ff0000;
}
none-working time is in blue instead of red