Find free time with Google Calendar api

I want to check if there is free time (no events) after a certain period of time in Google Calendar. There is a freebusy Google API, but it returns an array of events with dates.

"busy": [
    {
         "start": "2015-10-08T16:00:00+02:00",
         "end": "2015-10-08T20:00:00+02:00"
    },
    {
        "start": "2015-10-09T15:00:00+02:00",
        "end": "2015-10-09T16:00:00+02:00"
    },
]

Is there any easy way to get true / false free time info (some function for google api)? If not, perhaps you know a simple way to manually retry using a busy array and check for some empty space between events.

+4
source share
1 answer

Freebusy.query timeMin timeMax. , , , .

{
  "timeMin": datetime,
  "timeMax": datetime,
}
+3

Source: https://habr.com/ru/post/1611080/


All Articles