-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Labels
area:csom/rest/apiCategory: SharePoint Client Side Object Model SDK / REST APICategory: SharePoint Client Side Object Model SDK / REST APIstatus:trackedCurrently tracked with Microsoft’s internal issue tracking system. DO NOT ADD/REMOVE (MSFT managed)Currently tracked with Microsoft’s internal issue tracking system. DO NOT ADD/REMOVE (MSFT managed)type:archive-old-issueIssues which are closed as tool old for active workIssues which are closed as tool old for active work
Description
Category
- Question
- Typo
- Bug
- Additional article idea
Expected or Desired Behavior
When creating an all-day calendar ListItem, the start time should be 00:00 on the start date, and the end time should be 23:59 on the end date.
Observed Behavior
The resulting ListItem starts at 00:00 on the day before the expected start date. The end date and time are as expected.
Steps to Reproduce
POST https://graph.microsoft.com/v1.0/sites/root:/{sitename}:/lists/{listname}/items
// Single day, all-day event on 8/31/2018
{
"fields": {
"Title": "Test Event",
"EventDate": "2018-08-31T00:00:00",
"EndDate": "2018-08-31T23:59:00",
"fAllDayEvent": true
}
}Result
"fields": {
"EventDate": "2018-08-30T00:00:00Z", // A day earlier than expected
"EndDate": "2018-08-31T23:59:00Z",
...
}Note that the results are the same if EventDate and EndDate are specified with no time information, e.g. "2018-08-31".
Workaround
Adding a day to the EventDate field causes the created item to be correct. This works even if creating a single-day event, where it's necessary to specify a start date that's later than the end date:
{
"fields": {
"Title": "Test Event",
"EventDate": "2018-09-01T00:00:00", // Add a day.
"EndDate": "2018-08-31T23:59:00",
"fAllDayEvent": true
}
}"fields": {
"EventDate": "2018-08-31T00:00:00Z", // Correct!
"EndDate": "2018-08-31T23:59:00Z",
...
}Metadata
Metadata
Assignees
Labels
area:csom/rest/apiCategory: SharePoint Client Side Object Model SDK / REST APICategory: SharePoint Client Side Object Model SDK / REST APIstatus:trackedCurrently tracked with Microsoft’s internal issue tracking system. DO NOT ADD/REMOVE (MSFT managed)Currently tracked with Microsoft’s internal issue tracking system. DO NOT ADD/REMOVE (MSFT managed)type:archive-old-issueIssues which are closed as tool old for active workIssues which are closed as tool old for active work