In API V3 All Day Events from Google and Microsoft add an additional day

When integrating with calendar providers like Google and Microsoft through the Nylas API, you may notice that all-day events (datespan) events add an additional day, a one day event will appear as two days. This is expected behaviour.

Google Calendar

When Google Calendar returns an all-day event, it includes the end date as the day after the event. This means an event scheduled for July 11th will have an end date of July 12th. Here is an example response from Google:

 "start": {
  "date": "2024-07-11"
 },
 "end": {
  "date": "2024-07-12"
 }

Microsoft Calendar

Below is an example response from Microsoft Graph:

"start":{
   "dateTime":"2024-07-11T00:00:00.0000000",
},
"end":{
   "dateTime":"2024-07-12T00:00:00.0000000",
}

Nylas response

Matches the provider response (Google example response) .

"when":{
   "start_date":"2024-07-11",
   "end_timezone":"2024-07-12",
   "object":"datespan"
}

Conclusion

This is not a bug or an issue with the Nylas API. The observed behavior is a direct result of how Google and Microsoft handle all-day events. Providers handle this response within their respective clients.

As the developer you will need to handle this behavior also:

  • If "when":  {"object": "datespan"} then subtract a day to display the correct number of days.

Resources:

Events Endpoint

 

Updated

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.