如何在FullCalendar中设置当前日期颜色?
我想更改当天的颜色,但仅限日历在日程议程视图中。 我的用户说他们很难看到线条或东西。 我查看了文档以及css / js,但没有找到快速的方法。 如果没有重大代码更改,这是否可行?
老实说,我真的不知道你在说什么,但是jQuery UI fullcalendar小部件使用CSS类.fc-today
来设计当天的样式。 如果您的更改不可见,请尝试使用!important
– 可能是其他许多类中的一个会在其他地方覆盖您的样式。
你可以使用以下代码
.fc-today { background: #FFF !important; border: none !important; border-top: 1px solid #ddd !important; font-weight: bold; }
如果您没有使用主题,这对我使用FullCalendar 2.3.1
.fc-unthemed .fc-today { background: ....; }
我有多个日历,所以这有效:
#calendar .fc-today { background: #FFF !important; } #calendar-two .fc-today { background: #FFF !important; }
使用#calendar-favorite .fc-unthemed .fc-today { ... }
不起作用,所以请记住删除.fc-unthemed
部分。
还可以查看jquery方式: https : dayRender
使用dayRender
要在dayview中更改fullcalendar当前日期的颜色/背景,请添加以下CSS类,并确保在所有css样式之后加载它。
.fc-view-basicDay .fc-today { color:....; background:....; }
对我而言, .ui-state-highlight.fc-today
是.ui-state-highlight.fc-today