Creation of all day event using Graph >> shifted events when viewing calendars from other users in Outlook (timezone issue)

Marcelo Costa 46 Reputation points
2023-01-05T12:42:30.157+00:00

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:

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

276506-problem-graph-full.png

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.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,686 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Joe Jones 5 Reputation points
    2023-02-08T20:42:40.6166667+00:00

    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!

    1 person found this answer helpful.

  2. 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!

    0 comments No comments