I have a little web app. And I use a calender(code from here FullCalendar) there inside a .jsp file.
I use Spring mvc architecture. So when this page loaded a controller which is responsible for this page loading will add an attribute called calendarEventList to the model.
'calendarEventList' is an ArrayList<calObject>. calObject is a class which contain the details about the even.
I can access those details in the jsp by ${calEvent.eventID} where calEvent is an Object from that ArrayList.
In FullCalendar the event load can be called like below
$('#calendar').fullCalendar({
events: [
{
title : 'event1',
start : '2010-01-01'
},
{
title : 'event2',
start : '2010-01-05',
end : '2010-01-07'
},
{
title : 'event3',
start : '2010-01-09 12:30:00',
allDay : false // will make the time show
}
]
});
I want is like below
$('#calendar').fullCalendar({
events: //read the `calendarEventList` and create a suitable array
});
I have title ,start ,end .. details in a Oblect of the calendarEventList.
So I want to create the list which I need to give to the fullcalendar. How can I create such a kind of array in JS.
It's structure should match [{},{},{},...,{},{}] as given in the example. {} includes a detail about one Object in that calendarEventList ArrayList.
any detailed description will be highly appreciated.