I am fairly new to the FullCalendar, but totally love it's functionality.
I am trying to use the dayClick function. Perhaps someone can guide me in the right direction.
I currently have this:
dayClick: function (date, allDay, jsEvent, view) {
var titleNew = prompt('Event Title:');
var thedate1 = formatDate(date);
$.ajax({
url: "classes/class.Post.php?a=dayClickCalendarEvent",
dataType: 'json',
data: {
title: titleNew,
start: thedate1,
end: thedate1
},
success: function (data, response, event, date) {
$('#calendar').fullCalendar('renderEvent', titleNew);
},
error: function () {
alert("Oops! Something didn't work");
}
});
},
My problem is that I can't get the event to RENDER to the calendar no matter what.
Am I missing something? I am using the calEvent, where I found it on another Stack Overflow post.
Here is my format code:
function formatDate(date1) {
return date1.getFullYear() +'-'
+ (date1.getMonth() < 9 ? '0' : '')
+ (date1.getMonth()+1) +'-'
+ (date1.getDate() < 10 ? '0' : '')
+ date1.getDate() +' '
+ (date1.getHours() < 10 ? '0' : '')
+ date1.getHours() +':'
+ (date1.getMinutes() < 10 ? '0' : '')
+ date1.getMinutes();
}
Any help would be appreciated.