我已使用以下方式将日历添加到html
<div drag id='calendar'></div>
并将事件设置为日历
$(document).ready(function () {
SetCalender();
});
function SetCalender() {
var allEvents = [];
y = 2019;
m = 06;
d = 07;
allEvents.push({
title: 'event1',
start: '2019-07-07'
}, {
title: 'event2',
start: new Date(y, m, d + 1, 19, 0),
end: new Date(y, m, d + 1, 22, 30)
},
{
title: 'event3',
start: new Date(y, m, d + 1, 4, 0),
end: new Date(y, m, d + 1, 6, 30),
allDay: false,
});
$('#calendar').fullCalendar('removeEvents', function (eventObject) {
return true;
});
var calendar = $('#calendar').fullCalendar();
calendar.fullCalendar('addEventSource', allEvents);
}
但是我如何将上述事件添加为只读事件,这意味着用户无法拖放