我使用的是fullcalendar,我遇到了一种情况,我想限制事件拖到日期范围之外,所以我使用了eventconstraint,但不幸的是,它对我不起作用。如果我的代码中有任何错误,请纠正我。我篡改了我的代码
$(document).ready(function() {
var date = new Date();
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
editable: true,
eventConstraint:{
start: '2015-02-01T10:00:00',
end: '2015-02-15T22:00:00'
},
events: [
{
id: 999,
title: 'event',
start: new Date(2015, 1, 4)
},
],
});
});
您的小提琴正在使用fullcalendar 1.6.1
当前版本为2.2.6。
CCD_ 1仅在2.2中添加。
这是一个有效的小提琴(你也需要用于FC 2.0+的momentjs)。
CDN脚本:
https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment.min.js
http://cdnjs.cloudflare.com/ajax/libs/fullcalendar/2.2.6/fullcalendar.min.js
http://cdnjs.cloudflare.com/ajax/libs/fullcalendar/2.2.6/fullcalendar.min.css
总是在完整日历之前加载时刻。