Matching user availability periods

I would like to have users enter periods of the day that they are available for an activity. The system searches for which other users are available during the same period, and if there are matches, sends emails to those users that lists all the users who are available during this same period.

I assume you start with having fields for start time and end time, but after that, I’m stuck. Any help will be greatly appreciated!

Hey @FarFutureFox :wave:

Check out this video - it might give you a good idea of where to start!

Build it with Tim - How do I build a booking calendar? (Ep. 1)

Hi @FarFutureFox and welcome to the community.

This is very complex and doing such queries can be quite difficult. But thinking out loud we’ll see if we can come up with something together.

First, are these availabilities the same for each day, or is it all very custom? Meaning, does a user say they’re available:
Monday 9am - 5PM
Tuesday 5PM - 8PM etc…

Or is it:
September 12th, 2022 5PM-6PM
September 13th, 2022 7PM-10PM.

If its the former, I’d first come up with a table that designates each time slot with a unique number field. It’s far easier working with numbers than dates.

As an example:
12AM - 1259AM = #1
1AM - 1:59AM = #2
etc…

Then we would need to lookup all users where the numbers overlap.

I hope this maybe can point you in the right direction, I’m not clear on your exact requirements but wanted to jot down my initial thoughts on achieving this.

Hi Moe, thanks for the welcome and the reply.

It’s the first case you describe actually, general availability. More like “I’m typically available from 6pm-9pm on weekdays, and 2pm-5pm on Saturdays”.

Each user would do this, and as you say, the overlapping times generate emails to those users identifying to them the other users. These will link to those users’ profile pages.

Identifying the hours by numbers does sound simpler and doable, if I study.