我正在尝试使用Graph API在SharePoint Online日历列表中创建全天活动。如果我将开始时间指定为00:00,将结束时间指定为23:59,则会发生为期两天的活动,该活动将从前一天开始。看来我可以在想要的当天开始的唯一方法是在开始时增加额外的一天,实际上是请求一个事件,该事件在结束后 一分钟开始。我是在做错什么还是错误?
POST https://graph.microsoft.com/v1.0/sites/root:/{sitename}:/lists/{listname}/items
// Request:
{
"fields": {
"Title": "Test Event",
"EventDate": "2018-08-31T00:00:00",
"EndDate": "2018-08-31T23:59:00",
"fAllDayEvent": true
}
}
// Response: 2-day event starting the day before
"fields": {
"EventDate": "2018-08-30T00:00:00Z",
"EndDate": "2018-08-31T23:59:00Z",
...
}
// Request:
{
"fields": {
"Title": "Test Event",
"EventDate": "2018-09-01T00:00:00",
"EndDate": "2018-08-31T23:59:00",
"fAllDayEvent": true
}
}
// Response - correct!
"fields": {
"EventDate": "2018-08-31T00:00:00Z",
"EndDate": "2018-08-31T23:59:00Z",
...
}