Antonio Tiranti
Antonio Tiranti

Reputation: 3

fullcalendar v 2 php events not working

I am tryng to uptade the fullCalendar plugin to version 2 end now the events, generated by php scripts, are not being displayed at all. The php script works properly, since if I directly put its output into the events attribute of the fullCalendar object, like this:

events: <? require ("calendario_eventi.php"); ?>,

the events are displayed correctly.

Istead if I try to retrive the events using JSON feed like this:

events: {
                url: "calendario_eventi.php",
                type: 'GET',
                data: {
                    id_utente: '<?print $id_ut?>',
                    all: '<?print $all?>'
                },
                success: function(a, b, c) {
                    alert('success');
                },
                error: function(a, b, c) {
                    alert('there was an error while fetching events!'+a+b+c);
                }
            }

the plugin returns "success" but doesn't display the events in the calendar.

The php script generate this code:

[{"title":"Azienda: NOME AZIENDA S.r.l.Utente: NOME COGNOMESegnalazione: Segnalare i campi obbligatori con un asterisco.","start":"2014-09-01T08:30:00+0200","end":"2014-09-01T09:30:00+0200","allDay":false,"className":"segnalazione_cal","id":"1685","editable":false},{"title":"Azienda: NOME AZIENDA S.r.l.Utente: NOME COGNOMESegnalazione: Mettere le apparecchiature elencate nel menu a tendina del campo \\\"Apparecchiature\\\" in ordine alfabetico.","start":"2014-09-01T08:30:00+0200","end":"2014-09-01T09:30:00+0200","allDay":false,"className":"segnalazione_cal","id":"1684","editable":false},{"title":"Azienda: MyFGAS DemoUtente: Resp. tecnico tecnicoSegnalazione: PROVA MY GAS","start":"2014-09-01T08:30:00+0200","end":"2014-09-01T09:30:00+0200","allDay":false,"className":"segnalazione_cal","id":"1683","editable":false}]

Upvotes: 0

Views: 108

Answers (1)

Seether
Seether

Reputation: 1564

As you can read here, it appears that:

"Prior to version 1.3, formatDate accepted a very different format."

It looks like that your PHP script correctly generates start and end dates in the ISO8601 format, but on your second code snippet I can see no start nor end parameter being passed. Perhaps, by not specifying them explicitly, you're implicitly providing UNIX timestamps instead, making fullCalendar not able to read dates correctly.

Could that be the case?

Upvotes: 1

Related Questions