Fullcalendar:更改特定日子的颜色 [英] Fullcalendar: Change the color for specific days

查看:2092
本文介绍了Fullcalendar:更改特定日子的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在工作中遇到了一个项目。我需要改变一些日子的背景颜色。这是用户应该看到的日历,哪些日子可用,哪些不可用。我发现有一个名为data-date的属性,但我没有找到使用它的可能性。



有什么方法可以操纵背景具体的日子?



我认为必须有一种方法,导致显示当前日期的单元格也有另一种颜色。

月份, 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆