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

Automatically suggest times in common for partners #11

Open
elimelt opened this issue Apr 8, 2024 · 0 comments
Open

Automatically suggest times in common for partners #11

elimelt opened this issue Apr 8, 2024 · 0 comments

Comments

@elimelt
Copy link
Contributor

elimelt commented Apr 8, 2024

This might look like an expandable list of times next to every pairing entry.

Conveniently, we are already storing everything needed to add this as a feature! Availabilities are currently stored as a JSON array of 1s and 0s for each hour of the week. For example...

avail = [
   [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, ...],   // Sunday
   [0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, ...],   // Monday
   [...],                                       // Tuesday
   ...                                          // ...
]

means that whoever has availability avail is free from 6am-7am on Sunday, corresponding to avail[0][6], and 3am-4am on Monday, corresponding to avail[1][3] (early bird gets the worm).

So to implement this feature, you need to get the form_id of a given signup (it makes sense to only show this for the form actively being interviewed on, so check out services/form.ts:getActiveInterviewFormID), and then get the user's pairing for this form. Once you have both of the pair members' user_ids, find their signup for the form_id, which contains their availabilities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Unassigned Issues
Development

No branches or pull requests

1 participant