I am calling Microsoft graph api to create an event and send timezone e.g" Asia/Calcutta" but in response and in outlook calendar timezone set as "UTC"
payload: : {
"subject": "DBEP",
"body": {
"contentType": "HTML",
"content": "<div><a href="//salesprouat/calendar/?taskId=415511">View in SalesPro : DBEP</a></div>"
},
"start": {
"dateTime": "2024-04-10T08:00:00.000Z",
"timeZone": "Asia/Calcutta"
},
"end": {
se: "dateTime": "2024-04-10T08:15:00.000Z",
"timeZone": "Asia/Calcutta"
}
}
response:: {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('35deb0b3-deb8-48ca-8c8a-14470f76c63f')/calendar/events/$entity",
"@odata.etag": "W/"zpXVhlr7vUaPMiv+gOOB4AAAWmD4BQ=="",
"id": "AAMkAGVhODFkYTNhLWJlN2UtNDQ4Yi05YWU4LTNhYjJiOTI1YzIwNQBGAAAAAACFEN9owQ_WSaSTpFz0ElHUBwDOldWGWvu9Ro8yK-6A44HgAAAAAAENAADOldWGWvu9Ro8yK-6A44HgAABaafMLAAA=",
"createdDateTime": "2024-04-10T05:47:31.8300722Z",
"lastModifiedDateTime": "2024-04-10T05:47:31.8815325Z",
"changeKey": "zpXVhlr7vUaPMiv+gOOB4AAAWmD4BQ==",
"categories": [],
"transactionId": null,
"originalStartTimeZone": "UTC",
"originalEndTimeZone": "UTC",
"iCalUId": "040000008200E00074C5B7101A82E00800000000BD2C81940A8BDA0100000000000000001000000001341BF49A5A9E4182184D9961BFC311",
"reminderMinutesBeforeStart": 15,
"isReminderOn": true,
"hasAttachments": false,
"subject": "DBEP",
"bodyPreview": "View in SalesPro : DBEP",
"importance": "normal",
"sensitivity": "normal",
"isAllDay": false,
"isCancelled": false,
"isOrganizer": true,
"responseRequested": true,
"seriesMasterId": null,
"showAs": "busy",
"type": "singleInstance",
"webLink": "https://outlook.office365.com/owa/?itemid=AAMkAGVhODFkYTNhLWJlN2UtNDQ4Yi05YWU4LTNhYjJiOTI1YzIwNQBGAAAAAACFEN9owQ%2BWSaSTpFz0ElHUBwDOldWGWvu9Ro8yK%2F6A44HgAAAAAAENAADOldWGWvu9Ro8yK%2F6A44HgAABaafMLAAA%3D&exvsurl=1&path=/calendar/item",
"onlineMeetingUrl": null,
"isOnlineMeeting": false,
"onlineMeetingProvider": "unknown",
"allowNewTimeProposals": true,
"occurrenceId": null,
"isDraft": false,
"hideAttendees": false,
"responseStatus": {
"response": "organizer",
"time": "0001-01-01T00:00:00Z"
},
"body": {
"contentType": "html",
"content": "<html>\r\n<head>\r\n<meta http-equiv="Content-Type" content="text/html; charset=utf-8">\r\n</head>\r\n<body>\r\n<div>[//salesprouat/calendar/?taskId=415511]View in SalesPro : DBEP</div>\r\n</body>\r\n</html>\r\n"
},
"start": {
"dateTime": "2024-04-10T08:00:00.0000000",
"timeZone": "UTC"
},
"end": {
"dateTime": "2024-04-10T08:15:00.0000000",
"timeZone": "UTC"
},
"location": {
"displayName": "",
"locationType": "default",
"uniqueIdType": "unknown",
"address": {},
"coordinates": {}
},
"locations": [],
"recurrence": null,
"attendees": [],
"organizer": {
"emailAddress": {
"name": "Pratik Patil (external)",
"address": "Pratik.Patil@husqvarnagroup.com"
}
},
"onlineMeeting": null
}
code javascpript:
function getOutLookApiRequestObj(taskObj) {
const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
let outlookTaskRequestObj = {
"subject": taskObj.name,
"body": {
"contentType": "HTML",
"content": taskObj && taskObj.comment || "",
},
"start": {
"dateTime": taskObj.scheduled,
"timeZone": timeZone
},
"end": {
"dateTime": taskObj.planned_completion,
"timeZone": timeZone
},
}
return outlookTaskRequestOb