$(‘#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#
原文:http://www.cnblogs.com/xingmeng1213/p/5209326.html