【发布时间】:2020-05-09 02:11:55
【问题描述】:
Google 日历 API 将 end.date 视为 end.date - 1
我的 POST 负载
{
'summary': 'THREE DAY EVENT',
'status': 'confirmed',
'start': {
'date': '2020-01-27',
'timeZone': 'America/Los_Angeles'
},
'end': {
'date': '2020-01-29',
'timeZone': 'America/Los_Angeles'
}
}
这会在我的日历上产生以下事件
注意这3天全天的结束日期甚至是负1
当我对事件 id 执行 GET 时,我会返回一个正确的对象。
{
'kind': 'calendar#event',
'etag': '"REDACTED"',
'id': 'REDACTED',
'status': 'confirmed',
'htmlLink': 'REDACTED',
'created': '2020-01-22T20:15:23.000Z',
'updated': '2020-01-22T20:15:23.896Z',
'summary': 'THREE DAY EVENT',
'creator': {'email': 'REDACTED'},
'organizer': {'email': 'REDACTED',
'displayName': 'REDACTED',
'self': True},
'start': {'date': '2020-01-27'},
'end': {'date': '2020-01-29'},
'iCalUID': 'REDACTED',
'sequence': 0,
'reminders': {'useDefault': True}
}
我看过这个帖子——Google Calendar API: Event endTime is decremented by 1 day
根据 Google 日历 API 文档:https://developers.google.com/calendar/v3/reference/events/insert#request-body
end.date -- The date, in the format "yyyy-mm-dd", if this is an all-day event.
对于all-day 事件,不需要时间字符串,结果事件应该在我提供的范围内。生成的 API 响应正确,但 Google 日历中的事件不正确...
【问题讨论】:
标签: google-api google-calendar-api