Fullcalendar:更改特定日子的颜色 [英] Fullcalendar: Change the color for specific days
问题描述
有什么方法可以操纵背景具体的日子?
我认为必须有一种方法,导致显示当前日期的单元格也有另一种颜色。
basicWeek
和<$> 的解析方案 c $ c> basicDay 您可以通过提供 dayRender
函数来更改日子的呈现。例如: $(#calendar)。fullCalendar({
dayRender:function(date,cell){
cell.css(background-color,red);
}
});
dayRender
的文档可以在这里找到: http://arshaw.com/fullcalendar/docs/display/dayRender/
以下是jsfiddle的一个工作示例: http:/ /jsfiddle.net/kvakulo/CYnJY/4/
I'm stuck with a project I get at work. I need to change the background color of some days. It's a calendar where the user should see, which days are available and which not. I found out that there is an attribute called "data-date", but I didn't found a possibility to use it.
Is there any way to manipulate the background of specific days?
I think there must be a way, cause the cell which shows the current date has another color too.
For the views month
, basicWeek
and basicDay
you can change the rendering of the days by providing a dayRender
function. E.g.:
$("#calendar").fullCalendar({
dayRender: function (date, cell) {
cell.css("background-color", "red");
}
});
The documentation for dayRender
is available here: http://arshaw.com/fullcalendar/docs/display/dayRender/
And here's a working example on jsfiddle: http://jsfiddle.net/kvakulo/CYnJY/4/
这篇关于Fullcalendar:更改特定日子的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!