I am trying to use jMonthCalendar to add some events from an XML feed into a calendar. In the original jMonthCalendar, the events are in an array that looks like this:
var events = [
{ "EventID": 1, "StartDateTime": new Date(2009, 5, 12), "Title": "10:00 pm - EventTitle1", "URL": "#", "Description": "This is a sample event description", "CssClass": "Birthday" },
{ "EventID": 2, "StartDateTime": "2009-05-28T00:00:00.0000000", "Title": "9:30 pm - this is a much longer title", "URL": "#", "Description": "This is a sample event description", "CssClass": "Meeting" }];
I am using a loop to create a bunch of events like this:
eventsArray += '{"EventID":'+eventID+', "StartDateTime": '+new Date(formattedDate)+', "EndDateTime": '+new Date(formattedDate)+', "Title": "'+eventTitle+'", "URL": "'+detailURL+'","Description": "'+description+'"},'
I am then trying to get these back into an array by performing
eventsArray = eventsArray.slice(0, -1); var events = [eventsArray];
The problem is, the stuff in "eventsArray" does not get converted back into array objects, like it does in the example source.
I know that this is a noob question, but any help would be appreciated.