jquery - fullCalendar json 与 php 在 "agendaWeek"

标签 jquery xml json date fullcalendar

<link rel='stylesheet' type='text/css' href='fullcalendar/redmond/theme.css' />
<link rel='stylesheet' type='text/css' href='fullcalendar/fullcalendar.css' />
<script type='text/javascript' src='fullcalendar/jquery/jquery.js'></script>
<script type='text/javascript' src='fullcalendar/jquery/ui.core.js'></script>
<script type='text/javascript' src='fullcalendar/jquery/ui.draggable.js'></script>
<script type='text/javascript' src='fullcalendar/jquery/ui.resizable.js'></script>
<script type='text/javascript' src='fullcalendar/fullcalendar.min.js'></script>

<script type='text/javascript'>

 $(document).ready(function() {

  $('#calendar').fullCalendar({

   theme: true,
   editable: false,
   weekends: false,
   allDaySlot: false,
   allDayDefault: false,
   slotMinutes: 15,
   firstHour: 8,
   minTime: 8,
   maxTime: 17,
   height: 600,
   defaultView: 'agendaWeek',

   events: "json_events.php",

   loading: function(bool) {
    if (bool) $('#loading').show();
    else $('#loading').hide();
   }

  });

 });

</script>

但该信息不会显示在“agendaWeek”上。 谁能告诉我我做错了什么。

我的“json_events.php”代码是:

<?php

 $year = date('Y');
 $month = date('m');

 echo json_encode(array(

  array(
   'id' => 111,
   'title' => "Event1",
   'start' => "$year-$month-22 8:00",
   'end' => "$year-$month-22 12:00",
   'url' => "http://yahoo.com/"
  ),

  array(
   'id' => 222,
   'title' => "Event2",
   'start' => "$year-$month-22 14:00",
   'end' => "$year-$month-22 16:00",
   'url' => "http://yahoo.com/"
  )

 ));

?>

它输出以下内容:

[{"id":111,"title":"Event1","start":"2010-03-22 8:00","end":"2010-03-22 12:00","url":"http:\/\/yahoo.com\/"},{"id":222,"title":"Event2","start":"2010-03-22 14:00","end":"2010-03-22 16:00","url":"http:\/\/yahoo.com\/"}]

如果有人可以帮助或建议有人来帮助我,请。

谢谢, 丹尼斯

最佳答案

将事件的“allDay”属性设置为空字符串。 (设置为 false 不起作用。)

参见:Integrating jQuery fullcalendar into PHP website

关于jquery - fullCalendar json 与 php 在 "agendaWeek",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2497034/

相关文章:

json - 使用可配置键的 Swift 4 JSON 解码

javascript - 复制外部 json 数据并粘贴到本地 json 文件中

c - 是否可以使用 libxml2 C API 从 schematron 断言中获取 <value-of select ='' xpath here''> 值?

php - 如何从同一个客户端对同一个页面执行多个 HTTP 请求

jQuery UI 对话框 - 设置默认配置

javascript - 我如何计算函数在 jQuery 中花费的时间?

android - 我正在尝试为空 ListView 制作一个 TextView,但我无法从 Activity 中获取 ListView

android - 上半部分的按钮不可点击

php - 使用 PHP 数组将 JSON 内容保存在 Mysql 中 [调试]

javascript - Git 远程仓库没有显示在 <ul> 中