javascript - Event is not showing in Full Calender using codeigniter? -
i retrive events database using events url, events not display in fullcalnder??
my js codes
$('#inspectioncalendar').fullcalendar({ header: { left: 'next today', center: 'title', right: 'month,basicweek,basicday' }, editable: false, eventlimit: true, // allow "more" link when many events events: '<?php echo base_url(); ?>inspections/inspections_record', });
my controller action :
function inspections_record() { echo "[ { title: 'all day event', start: '2015-08-01' }, { title: 'long event', start: '2015-02-07' }, { id: 999, title: 'repeating event', start: '2015-08-09t16:00:00' }, { id: 999, title: 'repeating event', start: '2015-08-16t16:00:00' }, { title: 'conference', start: '2015-08-26' }, { title: 'meeting', start: '2015-08-25t10:30:00', }, { title: 'lunch', start: '2015-08-25t12:00:00' }, { title: 'meeting', start: '2015-08-25t14:30:00' }, { title: 'happy hour', start: '2015-08-12t17:30:00' }, { title: 'dinner', start: '2015-08-12t20:00:00' }, { title: 'birthday party', start: '2015-08-13t07:00:00' }, { title: 'click google', url: 'http://google.com/', start: '2015-08-28' } ],"; }
the console of browser shows response, events not showing in calender?
please me.
thanks
i think should remove comma @ end of json
echoing, right after ]
. have surround names , values in json double quotes instead of single quotes. make inspections_record()
like:
function inspections_record() { echo '[ { "title": "all day event", "start": "2015-08-01" }, { "title": "long event", "start": "2015-02-07" }, { "id": 999, "title": "repeating event", "start": "2015-08-09t16:00:00" } etc... ]'; }
conclusion: events json
feeding calendar not valid json
. cause calendar not show events.
Comments
Post a Comment