Skip to content

Automatically suggest times in common for partners #11

@elimelt

Description

@elimelt

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions