Jam*_*ett 1 jquery fullcalendar
我正在尝试使用jquery fullCalendar插件删除一天中的所有事件.这可能吗?
我试图通过removeEvents()函数来做,但我没有运气.文档说我可以传递一个事件对象参数,但我不确定这意味着什么.
提前致谢
詹姆士
试试这个:
$('#calendar').fullCalendar( 'removeEvents', function(event) {
if(event.start.toDateString()===new Date(2013, 1,1).toDateString())
return true;
});
Run Code Online (Sandbox Code Playgroud)
小提琴:http://jsfiddle.net/100thGear/wcR7a/
基本上,该removeEvents函数会遍历所有事件并将其传递给第二个参数.此参数是上面的函数 - 它检查这些事件并将true返回给所有必须删除的事件.
希望这可以帮助!