Javascript eventSources到events Json,完整日历
我正在尝试从eventSources获取对我的事件的json调用 我在eventSources中得到的json是:Javascript eventSources到events Json,完整日历,javascript,json,fullcalendar,Javascript,Json,Fullcalendar,我正在尝试从eventSources获取对我的事件的json调用 我在eventSources中得到的json是: [{"title":"Title Test","start":"1305841052"}] 当我将这个字符串转换为事件时,它正确地显示了日期。 是否有我遗漏的内容?初始化日历时,请确保有以下内容: $('#calendar').fullCalendar({ event: "json-feed.php", //more inits... }) <?php
[{"title":"Title Test","start":"1305841052"}]
当我将这个字符串转换为事件时,它正确地显示了日期。
是否有我遗漏的内容?初始化日历时,请确保有以下内容:
$('#calendar').fullCalendar({
event: "json-feed.php",
//more inits...
})
<?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...
));
?>
您的json-feed.php文件应类似于以下内容:
$('#calendar').fullCalendar({
event: "json-feed.php",
//more inits...
})
<?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...
));
?>
你说的“不正确”是什么意思(我想这就是你的意思)时间总是1小时。。2小时。。4小时不同?如果我在类似这样的事件中手动添加字符串:Events:[{“title”:“title Test”,“start”:“1305841052”}]
它工作得很好,请尝试返回非UNIX时间,而是带Z的ISO时间来禁用时区数据。但我不知道如何使用Json提要自动完成。它如何需要Json提要的标记?