My team's application is also running into this issue with integrated MS calendars. A few of us checked the "I have the same question" link on this page in hopes that would encourage a reply from MS. Perhaps adding a comment here will have an impact too. I look forward to hearing a potential solution. Thanks!
Creation of all day event using Graph >> shifted events when viewing calendars from other users in Outlook (timezone issue)
Hello,
We have an application that writes all day events, using Graph, to a user's calendar.
The target of the POST is "/users/<email-of-user>/calendar/events".
The payload of our POST is the following:
{
"subject" : "<subject>",
"body" : {
"contentType" : "text",
"content" : "<message>"
},
"isAllDay" : true,
"isReminderOn" : false,
"transactionId" : "<unique_id>",
"showAs" : "free",
"originalStartTimeZone" : "UTC",
"originalEndTimeZone" : "UTC",
"start" : {
"dateTime" : "<YYYY-MM-DD_of_all_day_event>T00:00:00.0000000",
"timeZone" : "UTC"
},
"end" : {
"dateTime" : "<YYYY-MM-DD_of_all_day_event+1>T00:00:00.0000000",
"timeZone" : "UTC"
},
"location" : {
"displayName" : "<location>"
}
}
The POST has been built taking into account information from the Graph documentation:
- isAllDay set to true ( reference )
- "start" and "end" dateTimeTimeZone set to midnight and in the same timezone ( reference )
- "originalStartTimeZone" and "originalEndTimeZone" set to UTC as well (due to the source of the event creation being a system running in UTC).
I have also adapted the POST above taking into account information from some links:
- JSON payload for allDay events example: https://www.eliostruyf.com/creating-all-day-events-with-the-microsoft-graph-on-office-365/
- Similar issue and discussion to my problem: https://github.com/microsoftgraph/microsoft-graph-docs/issues/2804#issuecomment-459336897
- Similar issue and discussion without solution: https://stackoverflow.com/questions/65349822/inconsistent-originalstarttimezone-for-all-day-events
- Similar issue and discussion without solution: https://stackoverflow.com/questions/42766205/microsoftgraph-events-that-are-all-day-show-utc-not-the-correct-time-zone
- SharePoint lightly related discussion: https://github.com/SharePoint/sp-dev-docs/issues/2755 ( this one not so relevant as it's SharePoint, but because it also uses the Graph API and same strange dateTime tricks I also add it)
The result of the above POST call is the following:
- For the user whose calendar we are writing to, independently of the timezone of that user, all is OK: the event is correctly set to allDay, and is displayed in the Outlook calendar correctly
- For users, whose timezone is UTC, which are viewing other users calendars, independently of the timezone of the target user, all is OK: the event is correctly set to allDay, and is displayed in the Outlook calendar correctly
- For users, whose timezone is not UTC, which are viewing other users calendars, independently of the timezone of the target user, a problem exists: the calendar of the target user's all day events are shifted in the amount of Hours between UTC and the target user timezone
In summary:
- All is OK for the self user's calendar, independently of timezone
- Not OK when viewing other users calendars if the self user in not in UTC
The image below tries to visually explain the issue:
- The same 3 users, and how other users are viewed from their perspective
After searching online (the links posted above) and the documentation, I cannot seem to find a clear path forward to solve the problem once and for all, which is guarantee all day consistent events when viewing other user's calendars, independently of timezone.
Would really appreciate any tips in the right direction.
Thanks in advance.
2 answers
Sort by: Most helpful
-
-
Long Nguyen Xuan 1 Reputation point
2023-02-13T03:32:05.0966667+00:00 I have the same issue. I cannot get the timezone of reservations is all-day.
I hope MS support team reply the topic,
Thanks!