fullcalendar解决同一时间段存在多个日程

$('#calendar').fullCalendar({
    defaultDate: '2014-11-10',
    header: {
        left: 'prev,next today',
        center: 'title',
        right: 'month,agendaWeek,agendaDay'
    },
    defaultView: 'month',
    events: [{
        start: '2014-11-12T13:00:00',
        end: '2014-11-12T16:00:00',
    }, ],
    selectable: true,
    select: function (start, end, jsEvent, view) {
        $("#calendar").fullCalendar('addEventSource', [{
            start: start,
            end: end,
            rendering: 'background',
            block: true,
        }, ]);
        $("#calendar").fullCalendar("unselect");
    },
    selectOverlap: function(event) {
        return ! event.block;
    }
});
给选择的每个时间加一句 block: true,就可以了
转自http://stackoverflow.com/questions/29181823/how-to-select-multiple-date-ranges-from-fullcalendar#

转载于:https://www.cnblogs.com/xingmeng1213/p/5209326.html

你可能感兴趣的:(fullcalendar解决同一时间段存在多个日程)