我们正试图让Fullcalendar显示一些事件。我们从DB的ajax调用中获取事件。然后在ajax成功处理程序中,我们将数组设置为Fullcalendar
上的events属性 $.ajax({
type: 'GET',
contentType: 'application/json',
url: '/api/Bookings/' + sessionStorage.getItem("id"),
success: function (eventsArr) {
eventSources: [
{
events: eventsArr,
color: 'blue',
textColor: 'white'
}
],
但事件并未显示在日历中。
返回的数组可能如下所示
[
{
"title": "",
"start": "2018-01-01T01:01:01",
"description": "fefefefef"
},
{
"title": "",
"start": "2018-05-15T12:03:00",
"description": "something"
},
{
"title": "sfse Undervisning",
"start": "2018-05-16T12:59:00",
"description": "something2"
},
{
"title": "Matematik",
"start": "2018-05-17T12:30:00",
"description": "2+2"
},
{
"title": "Dansk",
"start": "2018-05-18T13:00:00",
"description": "Vikingtiden"
},
{
"title": "test",
"start": "2018-05-29T00:00:00",
"description": "sefs"
},
{
"title": "something",
"start": "2018-05-30T00:00:00",
"description": "sef"
}
]