我可以使用以下代码使用 fullCalender.js 创建重复发生的事件
$('#calendar').fullCalendar({
defaultDate: moment(),
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
defaultView: 'month',
events: [{
title:"My repeating event",
start: '10:00', // a start time (10am in this example)
end: '14:00', // an end time (6pm in this example)
dow: [ 1, 4 ] // Repeat monday and thursday
}],
});
recurrent events on every week image
但是我需要对此进行一些控制,我的要求是每隔一周而不是每周重复一次事件,我需要修改/添加代码的地方,请帮助我
最佳答案
不久前我遇到了这个问题。如果我没记错的话,在 FullCalendar 中,您可以指定具有相同 ID 的多个事件。在重复 ID 的每个实例中,您可以指定不同的开始和结束日期。 FullCalendar 会将所有这些事件对象识别为 1 个事件。所以你可以做的是为第 1 周、第 3 周、第 5 周等创建一个事件,并确保它们都具有相同的 ID。我知道这并不理想,但当我之前对此进行研究时,这是我能找到的最佳答案。
关于javascript - fullcalendar.js 隔周重复发生的事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50168604/