There are 2 all-day events
1st. 2022-08-06
2nd. 2022-08-07
I'm preparing solution to get events from one day:
the problem is with time range, I don't understand why when I use hour 23:59:59 (endDateTime=2022-08-06T23:59:59) - the returned results contains 2nd day events too. It's look like timerange is corelated with user's timezone.
So when I change endDateTime to: 2022-08-06T21:59:59 the results are correct and contain only 1 event from requested day (1st day). The user's timezone is Eastern Standard Time (EST).
I'm still confused because changing user timezone (in outlook settings) doesn't impact on results.
How to get correct results?
Used query:
https://graph.microsoft.com/v1.0/users/099392bd-26d7-47ef-887d-46ef5332d774/calendarView?startDateTime=2022-08-06T00:00:00&endDateTime=2022-08-06T23:59:59&$top=100&$skip=0&$select=categories,start,end,subject,isCancelled
RESULTS (shortened):
1st day task start end datetimes
"start": {
"dateTime": "2022-08-06T00:00:00.0000000",
"timeZone": "UTC"
},
"end": {
"dateTime": "2022-08-07T00:00:00.0000000",
"timeZone": "UTC"
}
2nd day task start end datetimes
"start": {
"dateTime": "2022-08-07T00:00:00.0000000",
"timeZone": "UTC"
},
"end": {
"dateTime": "2022-08-08T00:00:00.0000000",
"timeZone": "UTC"
}