Closed AF3412 closed 5 years ago
Ok, i'm do it :)
Add new style: .calendar-weekend-day { font-weight: bold; color: red; }
Create code like:
$('#calendar').calendar({ startYear: new Date().getFullYear(), language: 'ru', weekStart: 1, customDayRenderer: function (element, date) { if (weekendMill.includes(date.getTime())) { $(element).addClass("calendar-weekend-day"); } }, clickDay: function (e) { let time = (e.date.getTime()); if (weekendMill.includes(time)) { weekendMill.splice(weekendMill.indexOf(time), 1); $(e.element).children(".day-content").removeClass("calendar-weekend-day");
} else {
weekendMill.push(time);
$(e.element).children(".day-content").addClass("calendar-weekend-day");
}
},
}); }
Hello! How to change the color of an element set with "customDayRenderer"?
Is it possible to set colors without the "customDayRenderer" method, as well as "clickDay", without clicking the mouse, dynamically after the calendar is displayed?
I'm generating calendar with next code: