Reputation: 1418
I am trying to use the plugin FullCalendar in my current project. I am using ajax to load the events, followed by a render command. My biggest problem now is the sidebar. If I put static start and end dates, I always have an "invalid" end date even though they are the same? Here is the code:
//get calendar events
$.post('/data/api/get-class-events/', {class_id: $('#classId').val()}, function (data) {
$.each(data, function(index, element) {
var items = data[index]['fields'];
var calendarObject = {
bg: 'blue',
description: items['details'],
end: '2017-02-02T05:15:00',
start: '2017-02-02T05:15:00',
title: items['title']
}
calendarEvents.push(calendarObject)
});
$('#calendar').fullCalendar( 'addEventSource', calendarEvents );
}, 'json');
This still gives me an invalid end date. I really don't understand how it can be invalid when it works for the start date.
Upvotes: 0
Views: 773
Reputation: 217
Not sure, but if you put the end date end to a later date will it work, it may throw up the same error if the end date is before the start date.
Upvotes: 1