I am working to integrate MySQL events in Fullcalendar.
I've read many guide/post but i can't import events from a json script. Now, if I paste the JSON result of "myfeed.php" in fullcalendar, my calendar works and it include all events. If I link fullcalendar to myfeed.php, the calendar is empty. I've tried, also, to link my calendar to fullcalendar's "get-events.php" (that should work with myfeed.php), but the calendar is always empty. :/
this is my fullcalendar:
$(document).ready(function() {
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
editable: true,
eventLimit: true, // allow "more" link when too many events
events: {
url: 'fullcalendar/php/get-events.php',
//url: 'fullcalendar/myfeed.php',
error: function() {
$('#script-warning').show();
}
},
loading: function(bool) {
$('#loading').toggle(bool);
}
});
});
this is the result of myfeed.php:
[{“id”:”1″,”title”:”allenamentosimone”,”allDay”:”false”,”start”:”1423036800″,”end”:”1423044000″,”url”:”pippo”},
{“id”:”2″,”title”:”allenamentodue”,”allDay”:”true”,”start”:”1423310400″,”end”:”1423335600″,”url”:”pluto”}]
and myfeed.php is visible on pastebin (for the site jsonformatter the result is a valid json, but the file isn't a valid json).
Any suggestion?
UPDATE:
I've changed the event url in:
url: 'fullcalendar/myfeed.php'
Also, i've changed the date format of my json in YYYY-MM-DD HH:II:SS and now i can see my events on fullcalendar. However I see all events in all day mode :/
This is the new json returnment:
[
{"id":"1","title":"allenamentosimone","allDay":"false","start":"2015-02-04 09:00:00","end":"2015-02-04 11:00:00","url":"pippo"},
{"id":"2","title":"allenamentodue","allDay":"true","start":"2015-02-07 13:00:00","end":"2015-02-07 20:00:00","url":"pluto"}
]
UPDATE N.2:
If i don't write anything in allDay section, my fullcalendar works perfectly! This is the last json returnment:
[
{"id":"1","title":"allenamentosimone","allDay":"","start":"2015-02-04 09:00:00","end":"2015-02-04 11:00:00","url":"pippo"},
{"id":"2","title":"allenamentodue","allDay":"true","start":"2015-02-07 13:00:00","end":"2015-02-07 20:00:00","url":"pluto"}
]