我正在开发一个wordpress项目,其中需要显示具有特定日期颜色的日历:星期六为黄色,星期一为蓝色等等......我尝试使用FullCalendar插件,但未尝试“T工作,这里有一个例子:Wordpress日历中的天数
.fc-sat, .fc-sun{
background-color: yellow;
}
如何去改变它或任何想法,如果有另外一个插件,会做这项工作?
我正在开发一个wordpress项目,其中需要显示具有特定日期颜色的日历:星期六为黄色,星期一为蓝色等等......我尝试使用FullCalendar插件,但未尝试“T工作,这里有一个例子:Wordpress日历中的天数
.fc-sat, .fc-sun{
background-color: yellow;
}
如何去改变它或任何想法,如果有另外一个插件,会做这项工作?
在日历的初始化定义eventAfterRender
如下:
$('#calendar').fullCalendar({
eventAfterRender: function (event, element, view) {
if (event.start.day() == 0) {
element.css('background-color', 'blue');
element.css('border-color', 'blue'); // colors first day of the week blue
}
else if (event.start.day() == 1) {
...
}
else {
...
}
});
它完美的作品谢谢你!我不得不改变它,因为我没有考虑事件。这里是我如何改变:if(date.day()== 0){cell.css('background-color','blue'); cell.css('border-color','blue'); //本周第一天的颜色蓝色 } –
在你主题CSS试试这个:
.fc-sat{ background: yellow !important; }
在其中放置CSS? – mariobros
我把它放在fullcalendar.css文件中 –
尝试ad!important afrer yellow – mariobros