Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculate availabilities #67

Open
bonnieli opened this issue Dec 9, 2020 · 1 comment · May be fixed by #70
Open

Calculate availabilities #67

bonnieli opened this issue Dec 9, 2020 · 1 comment · May be fixed by #70
Assignees

Comments

@bonnieli
Copy link
Contributor

bonnieli commented Dec 9, 2020

Form the array of availabilities

  • hard code between 9am to 5pm
  • pass in meeting id to figure out duration
  • each "available slot" (item in the array) should be the length of the meeting type duration
  • if you calculate that a meeting slot will over lap a "busy" google calendar event, you don't include it

return an array to the frontend

@singhmi4
Copy link
Collaborator

Hi @bonnieli, I was able to calculate the availabilities using freequery and pushing the timeslots into an array, but I'm having some challenges returning this array out of the freebusy query to be sent to the front-end as a response.json().

Could you also look at my method of calculating the availabilities:

  • I started off by building an array of timeslots assuming full availability from 9 to 5 ([9:00, 10:00, ..., 4])
  • I then looped through the timeslots from that array and using the duration of the meeting as the start and end time respectively to query the freebusy API (eg. timeMin = 9 am, timeMax=9:59 (had to subtract 1 for the duration because I want to be able to set events that have only 1 hour time blocks available)
  • if the freebusy api returns an empty object, I then push that timeslot to a new array which I want to send to the front-end

https://github.com/hatchways/team-vampire/compare/feature-be-google-calendar-freebusy-api

@singhmi4 singhmi4 linked a pull request Dec 21, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants