'How to deal with recurring events using the google calendar API?
I'm using the Google Calendar API and nodejs. I have an app that allows patients to book appointments with doctors. But first, I check the doctor's calendar to make sure they do not have appointments at this time. How can I tell if an event is recurring? Does it show up multiple times when I make a list API call or only once?
Solution 1:[1]
When you have a recurrent event the ID changes a lot. For example, a regular event ID would look like 3qoortuglk75k7fjhgmd9k2enn, but the event ID from a recurrent event would be like 3qoortuglk75k7fjhgmd9k2enn_20220217T160000Z. If you see it has additional information related to the date and time. You could try to use something like that to recognize if the event is recurrent or not.
When listing events with the API you also have the request parameter singleEvents. You could use it to list only single events and compare them to the full list of events to see which ones are recurrent events.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Fernando Lara |
