Creating a calendar event with Graph API shows wriong time and timezone
Johan Stenkvist
5
Reputation points
I have a React application where I create and update calendar events via Microsoft Graph API.
Everything works as expected except for one part.
The time and timezone are shown wrong when viewing an event in Outlook.
In the views "Day", "Work week", "Week" and "Month" it shows correctly, but when entering the calendar event to view details, both time and timezone are wrong.
This is the event object I am saving via Microsoft Grap API:
{
subject: "Event title",
body: {
content: "Description",
contentType: "text"
},
start: {
dateTime: "Mon May 29 2023 21:30:00 GMT+0200 (Central European Summer Time)",
timeZone: "Europe/Stockholm",
},
end: {
dateTime: "Mon May 29 2023 22:30:00 GMT+0200 (Central European Summer Time)",
timeZone: "Europe/Stockholm",
},
organizer: {
emailAddress: {
address: "******@hotmail.com",
name: "Jxxx",
},
},
attendees: [
{
emailAddress: {
address: "******@hotmail.com",
name: "Jxxx",
},
type: "required",
},
],
responseRequested: true,
}
This is how it looks in "Week" view in Outlook:
And this is how it looks when I open the calendar event:
Outlook | Windows | Classic Outlook for Windows | For business
Microsoft Security | Microsoft Graph
Microsoft Security | Microsoft Graph
An API that connects multiple Microsoft services, enabling data access and automation across platforms
Sign in to answer