3
I’m working on a project with Fullcalendar, and I’m not being able to show the events correctly in their respective schedules. I feed the calendar with a Json (PHP system):
[
{
"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 understand where the problem is so that the event is not shown at the correct time! Only events with duration "allDay" appear in the correct line.
"id":"16" is out of time so it’s all day, check if JSON isn’t breaking because of "id":"17" accentuation seems to me to have accentuation.
– HENRIQUE LOBO
@HENRIQUELOBO, I removed the accent and continues to mark as a whole day, including events with hours. =(
– Wanessa Marques
After you set up the array you are converting to JSON ? echo json_encode(name_array);
– HENRIQUE LOBO
Exactly that! foreach($Row as $key => $value) { if (is_string($key)) { // Create an array with the field name // as key (Key) and the value (Value). $Fields[mysql_field_name($table,$i++)] = utf8_encode($value); } } // $json_result is the array you will receive // the values of the $Fields $json_result[ ] = $Fields ; } $JSON = json_encode($json_result); print_r($JSON);`
– Wanessa Marques
Try echo json_encode($json_result); instead $JSON = json_encode($json_result); print_r($JSON);`
– HENRIQUE LOBO