FullCalendar does not display the event according to the time

3

I'm working on a project with FullCalendar, and I'm not able to correctly display the events at their respective times. Food the calendar with a Json (system in PHP):

[
   {
      "id":"13",
      "title":"Varredura no sistema - Verificar falhas e consert\u00e1-las",
      "start":"2017-05-04",
      "end":"2017-05-07",
      "allDay":"true",
      "className":"evento"
   },
   {
      "id":"16",
      "title":"Teste",
      "start":"2017-06-02",
      "end":"2017-06-02",
      "allDay":"false",
      "className":"evento"
   },
   {
      "id":"17",
      "title":"Teste com hor\u00e1rio",
      "start":"2017-06-09T10:30:00",
      "end":"2017-06-09T11:30:00",
      "allDay":"false",
      "className":"evento"
   }
]

I have read and reread the documentation and can not figure out where the problem is so the event is not shown at the correct time! Only "allDay" events appear on the correct line.

Can someone give me a light ?! Thank you in advance!

    
asked by anonymous 22.06.2017 / 21:10

1 answer

1

Example of how to mount the array to then return to the JSON object literal:

foreach ($aAgenda as $k => $v) {    
 $dados[] = array('id'    => $v->id,
                  'title' => $v->title,
                  'start' => $v->start,
                  'end'   => $v->end);
}
echo json_encode($dados);

Do this test and check if it will appear right in the calendar, comment on the foreach and put that code:

 $dados[] = array('id'    => 1,
                  'title' => 'Teste',
                  'start' => '2017-06-23 12:30:00',
                  'end'   => '2017-06-23 13:30:00',);

echo json_encode($dados);
    
23.06.2017 / 21:01