Google Calendar API algorithm to find open time slots for a given day
问题 I'm trying to leverage Google Calendar (and Google Calendar API) for simple scheduling. I'm using PHP, MySQL and google-api-php-client. I'm looking for a algorithm or pseudocode to find open time slots. My calendar has events for busy times such as when business is closed and for current appointments. I am able to retrieve event start and end times via two function (Events: list and Freebusy: query). Here is a example list of events for today with start time of 2016-02-19T01:00:00-07:00 and