Created
September 14, 2020 15:26
-
-
Save nleiva/3837be0b775e86177db119db1e2f8e80 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func isItBusy(min string) (bool, error) { | |
... | |
// max -> min.Add(1 * time.Hour) | |
max, err := maxTime(min) | |
// ... | |
srv, err := calendar.New(client) | |
// ... | |
freebusyRequest := calendar.FreeBusyRequest{ | |
TimeMin: min, | |
TimeMax: max, | |
Items: []*calendar.FreeBusyRequestItem{&cal}, | |
} | |
// ... | |
freebusyRequestResponse, err := freebusyRequestCall.Do() | |
// ... | |
if len(freebusyRequestResponse.Calendars[name].Busy) == 0 { | |
return false, nil | |
} | |
return true, nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment