Is there a way to integrate jquery fullcalendar with MySQL using Spring MVC? I need to fetch schedule data from MySQL and display it on the calendar. Can you please demonstrate how to do this?
<script type='text/javascript'>
$(document).ready(function() {
var calendar;
var date = new Date();
var y = date.getFullYear();
var m = date.getMonth();
var d = date.getDate();
$('#calendar').fullCalendar({
header : {
left : 'title,prev,next today',
center : '',
right : 'month,agendaWeek,agendaDay'
},
height: 650,
selectable: true,
select: function(start, end, allDay) {
var title = prompt('Event Title:');
if (title) {
calendar.fullCalendar('renderEvent',
{
title: title,
start: start,
allDay: allDay
},
true // make the event "stick"
);
}
calendar.fullCalendar('unselect');
},
editable : true,
events: [
<c:forEach var='event' items='${myData.events}'>
{ title: '${event.title}', start: new Date (${event.timestamp}) },
</c:forEach>
null // the trailling comma is avoid the stray trailing comma.
];
});
});
</script>
Do you think it's possible to achieve this integration? If so, could you please provide guidance on how to implement it? Additionally, in order to integrate fullcalendar with the database, is it necessary to use PHP feed, Json, and Ajax? Your assistance would be much appreciated.