Google Calendar JSON API: Full-day events always one day longer

可紊 提交于 2019-12-02 18:56:22

问题


Since recently the JSON API always seems to add a day when returning the timespan for full-day events.

Display in Google Calendar Web app:

Yet what the JSON API returns is this:

{
"kind": "calendar#event",
"etag": "\"2896554426340000\"",
"id": "...",
"status": "confirmed",
"htmlLink": "https://calendar.google.com/calendar/event?eid=...",
[...]
"summary": "...",
[...]
"start": {
  "date": "2016-02-01"
},
"end": {
  "date": "2016-02-02"
},
[...]
"iCalUID": "...@google.com",
"sequence": 0
}

回答1:


In the Calendar API the start is inclusive and the end is exclusive. That's why the end will be the next day (which is excluded).



来源:https://stackoverflow.com/questions/34992747/google-calendar-json-api-full-day-events-always-one-day-longer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!