jQuery周日历:未在日历中加载现有数据

时间:2012-08-18 06:53:38

标签: jquery ajax json calendar

我正在尝试使用jQuery周历{4}来显示我网页上的现有会议我的问题是当日历加载我的events.php文件正在返回json数据时

[{"id":"2","title":"Analytics","body":"Analytics","start":"2012-08-14 12:00:00","end":"60"},{"id":"8","title":"bvxc","body":"bvxc","start":"2012-08-17 12:00:00","end":"60"},{"id":"9","title":"anyp","body":"anyp","start":"2012-08-17 13:00:00","end":"60"},{"id":"16","title":"Analytbfn","body":"Analytbfn","start":"2012-08-17 10:45:00","end":"2012-08-17 12:30"},{"id":"17","title":"Analytbfn","body":"Analytbfn","start":"2012-08-16 08:00:00","end":"2012-08-16 10:15"},{"id":"18","title":"Analytbfn","body":"Analytbfn","start":"2012-08-18 07:30:00","end":"2012-08-18 11:00"}]

但这些数据未在我的日历中加载

查看我的demo.js文件的https://github.com/themouette/jquery-week-calendar/wiki 请告诉我我在哪里做错了

2 个答案:

答案 0 :(得分:0)

您应该返回一个名为“events”的属性的JSON对象,并将其值设置为事件集合。前三个事件的“结束”参数也是不正确的。它应指明约会的结束日期+时间而不是持续时间(60)。

这将有效:

{
 events: [{ "id": "2", "title": "Analytics", "body": "Analytics", "start": "2012-08-14 12:00:00", "end": "2012-08-14 13:00:00" }, { "id": "8", "title": "bvxc", "body": "bvxc", "start": "2012-08-17 12:00:00", "end": "2012-08-17 13:00:00" }, { "id": "9", "title": "anyp", "body": "anyp", "start": "2012-08-17 13:00:00", "end": "2012-08-17 14:00:00" }, { "id": "16", "title": "Analytbfn", "body": "Analytbfn", "start": "2012-08-17 10:45:00", "end": "2012-08-17 12:30" }, { "id": "17", "title": "Analytbfn", "body": "Analytbfn", "start": "2012-08-16 08:00:00", "end": "2012-08-16 10:15" }, { "id": "18", "title": "Analytbfn", "body": "Analytbfn", "start": "2012-08-18 07:30:00", "end": "2012-08-18 11:00"}]
    }

答案 1 :(得分:0)

您应该以这种格式使用START,END时间

yyyy-MM-ddTHH:mm:ss

  EX : "start" :"2012-08-14T12:00:00"
       "end":"2012-08-14T13:00:00"