gpt4 book ai didi

fullcalendar - Fullcalendar 的彩色周末

转载 作者:行者123 更新时间:2023-12-04 04:07:56 28 4
gpt4 key购买 nike

我正在使用 FullCalendar 组件,我需要为周末、周五和周六着色。
我已经按照这里的建议使用了以下内容:
Can I set a different color for the weekend on monthly fullCalendar display

$('table.calendar > tbody > tr > td:nth-child(-n+2)').addClass('fc-weekend');

我还添加了 css 类。

这是我不为周末着色的代码......任何建议!
$(document).ready(function() {
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
$.getJSON('[@spring.url '/loadSomeData'/]', function (data) {
$.getJSON('[@spring.url '/loadOtherData/]', function (info) {
information = returnedPublicVacation;

var calendar = $('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
selectable: true,
selectHelper: true,
select:
function(start, end, allDay) {
vacationStart = start;
showTheCorrectDialog(vacationStart);
},

eventClick: function(calEvent, jsEvent, view) {

showTheCorrectDialog(calEvent.start);

// change the border color just for fun
$(this).css('border-color', 'red');
},

editable: true,
events:data.concat(information)
});
resourceVacation = data;
});
});

$('table.calendar > tbody > tr > td:nth-child(-n+2)').addClass('fc-weekend');
});

最佳答案

您是否在 css 文件中为类添加了样式?

你也可以试试这个:

.fc-fri { color:blue; }
.fc-sat { color:red; }

(或 .fc-sun 周日)
您可以在此处查看示例: http://jsfiddle.net/rajesh13yadav/nf9whojL/1/

关于fullcalendar - Fullcalendar 的彩色周末,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13918387/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com