-1
我的代碼是活動不插入在自舉日曆
events: function(callback) {
$.ajax({
url: 'schoolmanagement/jsonevents',
dataType: "json" ,
success: function(doc) {
var events = [];
$(doc).find('el').each(function() {
events.push({
title: $(this).attr('title'),
start: new Date($(this).attr('start')),
end: new Date($(this).attr('end')),
allDay: true,
className: 'bgm-cyan',// will be parsed
});
});
callback(events);
}
});
},
和我的JSON響應是
{"el": [
{"end":"2016-09-25T00:00:00","start":"2016-09-25T00:00:00","title":"Weekly Holiday"},
{"end":"2016-10-02T00:00:00","start":"2016-10-02T00:00:00","title":"Gandhi Jayanti"},
{"end":"2016-10-09T00:00:00","start":"2016-10-09T00:00:00","title":"Weekly Holiday"},
{"end":"2016-09-15T00:00:00","start":"2016-09-15T00:00:00","title":"School Foundation day"}
]}
提供鏈接到日曆文檔 – madalinivascu
https://fullcalendar.io/docs/event_data/events_function/ –