fullcalendar 的正确 JSON 日期时间语法
需要一些帮助来了解在议程视图中显示事件时间的正确语法。尽管将 allDay 设置为 false,但这些事件仅在全天下显示。
我的 json.html 页面如下所示:
$(document).ready(function() {
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
eventSources: [
{
url: 'json-events.php', // use the `url` property
color: 'yellow', // an option!
textColor: 'black', // an option!
editable: false
},
// Dont forget coma - but not on the last one
{
url: 'other-events.php', // use the `url` property
color: 'red',
textColor: 'black',
editable: 'false',
allDay: 'false'
}
// any other sources...
]
});
});
其中一个 php 页面如下所示:
<?php
echo json_encode(array(
array(
'id' => 112,
'title' => "What is this?",
'start' => "2011-10-11T13:00:00",
'end' => "2011-10-12T15:00:00",
'allDay' => "false"
),
));
?>
How do I get the events to display in the week and dayaged view with the right time (而不是列在“全天”部分下) ?
谢谢, 极限新手
need some help for the proper syntax for display the event times in agenda view. The events only shows up under all day despite having allDay set to false.
My json.html page looks like this:
$(document).ready(function() {
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
eventSources: [
{
url: 'json-events.php', // use the `url` property
color: 'yellow', // an option!
textColor: 'black', // an option!
editable: false
},
// Dont forget coma - but not on the last one
{
url: 'other-events.php', // use the `url` property
color: 'red',
textColor: 'black',
editable: 'false',
allDay: 'false'
}
// any other sources...
]
});
});
One of the php pages looks like this:
<?php
echo json_encode(array(
array(
'id' => 112,
'title' => "What is this?",
'start' => "2011-10-11T13:00:00",
'end' => "2011-10-12T15:00:00",
'allDay' => "false"
),
));
?>
How do I get the events to display in the week and day agend view with the proper time (instead of being listed under the "all day" section)?
Thanks,
Extreme Newbie
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
调整代码后,我通过删除 false 周围的“”使其工作。 php 页面应该如下所示:
:)
After tweaking the code, I got it to work by removing the "" around false. The php page should look like this:
:)
您需要去掉“false”的引用。 “false”是字符串,而“bool” false 是正确的 false。
另外,您的 json 调用应该有一个查询,例如...
后跟一个 while 语句来检索信息...
然后编码...
这将呈现数据库中的任何数据。
while 语句中的一个简单的 if 语句会将字符串更改为布尔值,如下所示...
希望这会有所帮助!
You need to take the quotation off of "false". "false" is a string, and false is the correct "bool" false.
Also, your json call should have a query such as...
Followed by a while statement to retrieve the information...
Then encode...
This will render whatever data you have in the database.
A simple if statement within the while statement will change the string to a bool like so...
Hope this helps!