eventSources to events Json, full calendar

房东的猫 提交于 2019-12-11 03:59:32

问题


I'm trying to get my json call from eventSources to my events.

The json I get back in my eventSources is :

[{"title":"Title Test","start":"1305841052"}]

When I past this string into events, it display's the date correctly. Is there something i'm missing ?


回答1:


when you initialize the calendar, be sure to have the following:

$('#calendar').fullCalendar({
    event: "json-feed.php",
    //more inits...
})

your json-feed.php file should look similar to the following:

<?php
    echo json_encode( array(
        array(
            'id' => 123,
            'title' => "myevent",
            'start' => "2011-05-24 10:05:00",
            'end' => "2011-05-24 11:55:00",
            'allDay' => false
         ),
         //more events...
     ));
?>


来源:https://stackoverflow.com/questions/6061311/eventsources-to-events-json-full-calendar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!