我正在使用CodeIgniter构建具有Fullcalendar的应用程序,并试图集成Google日历。当从Google日历中检索事件时未呈现事件JSON编码
我无法使用JS并且首选使用PHP,所以我有一个名为Calendar.php
的控制器调用Google Calendar API,获取主日历并列出事件。
编辑:这就是我现在越来越:
物体看起来像这样
GET http://localhost/admin/calendar/gcal...?start=2016-09-25&end=2016-11-06&_=1476324367596
200 OK 2.68s
响应
[{“title”:“lobna elatreby @nrc”,“type”:“gcal”,“calendar_id”:356,“notes”:“notes”,“start”:“2010-03-23T14 : 30:00-04:00“,”结束“:”2010-03-23T15:30:00-04:00“},{”title“:”生物测试1“,”类型“:”gcal“ calendar_id“ :356,”notes“:”notes“,”start“:”2013-02-08T18:30:00-05:00“,”end“:”2013-02-08T19:30:00-05 :
我用json_encode 00" }]([ '事件'=> $ eventsArr]),我得到了同样的错误
弃用警告。力矩()区已过时,使用力矩()UTCOFFSET代替。 参数:2010-03-23T14:30:00-04:00
弃用/ fullcalendar/moment.min.js:309:98 ...............
类型错误:t.start未定义
函数C(t)的{空== t.allDay & &(t.allDay =(t.start.hasTime()|| t.end & &! t.end.hasTime ...
我试过了下载&更新了Moment.js,我试过了更改日期格式... Google Calender API “时间,作为组合的日期时间值(根据RFC3339格式化)。除非在timeZone中明确指定时区,否则需要时区偏移量。“
仅复制的请求响应,并验证字符串是否使用(JSON格式)一个有效的JSON {https://jsonformatter.curiousconcept.com/(例如)。如果json无效,则不会呈现事件。要回复此消息,请务必在评论中添加@milz。 –
@milz你是绝对正确的,我试图修复日期格式,但codeigniter日期助手不会格式化为RFC-4627。它将格式化为ISO-8601,HTTP Cookies,Atom和一些使用jsonformatter的RFC格式,但显然不起作用。有没有办法使用标准的PHP转换日期?谢谢 – nivanmorgan
请复制json字符串并将其发布到您的问题而不是图像上。如果没有完整的json字符串,我无法测试它。谢谢。 –