Limit days to a single all day event in month view
Is it possible to limit a day to a single all day event in month view? This ideally would handle individual date selections, as well as date ranges.
There is most certainly a better way to do this, but this is what I was able to come up with for the time being. I'd like to be able to accomplish this without having to loop all of the events.
select: function (newEvent_start, newEvent_end, allDay) {
var okToAdd = true;
$('#calendar').fullCalendar('clientEvents', function (event) {
if ( (newEvent_start >= event.start && newEvent_end <= event.end) || // between
(newEvent_start <= event.start && newEvent_end >= event.start) || // starts before, ends during
(newEvent_start >= event.start && newEvent_start <= event.end && newEvent_end >= event.end) // starts during, ends after
)
okToAdd = false;
});
if (okToAdd) {
calendar.fullCalendar('renderEvent',
{
title: 'Title goes here',
start: newEvent_start,
end: newEvent_end,
allDay: allDay
},
true
);
}
calendar.fullCalendar('unselect');
}
链接地址: http://www.djcxy.com/p/14256.html
上一篇: FullCalendar月查看事件,无需调整日历的单元格大小
下一篇: 在月视图中将天数限制为单一的全天事件