gpt4 book ai didi

javascript - eventSources 到事件 Json,完整日历

转载 作者:行者123 更新时间:2023-11-30 06:04:24 25 4
gpt4 key购买 nike

我正在尝试将我的 json 调用从 eventSources 调用到我的事件。

我在 eventSources 中得到的 json 是:

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

当我将此字符串传递到事件中时,它会正确显示日期。有什么我想念的吗?

最佳答案

初始化日历时,请务必具备以下条件:

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

您的 json-feed.php 文件应类似于以下内容:

<?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...
));
?>

关于javascript - eventSources 到事件 Json,完整日历,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6061311/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com