I want to add some Events after the fullCalendar object is create... I'm working with PHP and JavaScript.
I have create fullCalendar object and after i want to add some events.
Here is the PHP code:
function BuildEvents() {
// Showing the calendar
echo '<div id="fCald"></div>';
// Events building
$evJSON = json_encode(array(
array('title' => "Evt.1",
'start' => "2010-12-22",
'url' => "#"),
array('title' => "Evt.2",
'start' => "2011-01-15", 'end' => "2011-01-19",
'url' => "http://yahoo.com/")
));
// Adding Events to object
$fCal = '$("#fCald").fullCalendar("addEventSource", '.$evJSON.')';
//Final showing
echo '<script type="text/javascript">'.
'eval('.$fCal.');'.
'</script>';
}
When PHP function is call, the JSON array is OK, but the events are not showing on the calendar...
I also test this code:
$fCal = '$("#fCald").fullCalendar("renderEvent", '.$evJSON.', true)';
and this is not working to...
I don't understand how to display events after building the fullCalendar object.
Thanks.
Luc M.