问题描述
我使用在我的asp.net应用程序。有四个 ASP:按钮
S IN下面我的应用程序
I'm using FullCalendar in my asp.net application. There are four asp:Button
s in my application as below.
Weekends
Weekdays
Month
Year
在对周末
按钮用户点击,我需要改变当前的月份周末天
的背景颜色。
When user click on Weekends
button, i need to change the background color of Weekend days
of current month.
在对平日
按钮用户点击,我需要改变当月平日
的背景颜色。
When user click on Weekdays
button, i need to change the background color of Weekdays
of current month.
在对月
按钮用户点击,我需要改变的背景颜色当月所有日子
。
When user click on Month
button, i need to change the background color of all days
of current month.
在对年度用户点击
按钮,我需要改变的背景颜色本年度的所有日子
。
When user click on Year
button, i need to change the background color of all days
of current year.
我有什么到目前为止已经试过:
下面是改变背景颜色的周末。周末的这种改变背景颜色,包括其他月份这是目前显示在日历。但我只需要改变目前的月周末只背景颜色。
Here is the Demo for change background color for weekends. this change background color of weekends including other months which are currently display on calendar. but i need to change only current months weekends background color only.
我怎样才能做到这一点?
How can i achieve this ?
推荐答案
您在您的演示几乎没有。你只需要过滤掉的日子,在其他月份 - 幸运的是FullCalendar标志着CSS类那些日子 FC-其他个月
You are almost there in your demo. You just need to filter out the days that are in other months - and luckily FullCalendar marks those days with the CSS class fc-other-month
.
通过稍微改变这里的code是你如何能在周末做:
By changing your code slightly here's how you could do it for weekends:
$('#weekends').click(function() {
$('.fc-day.fc-sat').not('.fc-other-month').css('backgroundColor','#bce8f1');
$('.fc-day.fc-sun').not('.fc-other-month').css('backgroundColor','#bce8f1');
});
和上的jsfiddle一个更新的演示:
And an updated demo on jsfiddle: http://jsfiddle.net/z8Jfx/22/
这篇关于更改FullCalendar的日子背景颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!