Blocking specific date ranges forever for users


I’m building an app where people can book birthday events from entertainers.

Events can only happen on specific days of the week (Wed/Sat/Sun) and one can run 2 events per day (Morning/Afternoon). Clients can choose a date within these days of the week, pick either morning or afternoon and the app will filter the available entertainers who can accept.

At account creation, animators must choose the days they’re available and the time of the days but with no specific range (for example every wednesday full day, saturday mornings and sunday afternoons).

But I see no way of blocking every occurence of these specific days of the week in the future, since the “date range list” expects a set list of dates. The current way I imagined implementing this feature is already quite complex :

  1. Creating an AM/PM option set with all possible occurences (Wednesday AM, Wednesday PM, Saturday AM, etc.) and adding it to a “Availabilities” data type for my user (entertainers)
  2. Creating a fixed “date range” data type in this option set, for example 8 to 12 AM and 2 to 6 PM
  3. At account creation, set availabilities for this entertainer

Then, when creating a request for an event :

  1. When the client picks a date, have a button appear where they can choose “Morning” or “Afternoon”
  2. set a custom state on the page so that if morning is picked, we set a date range of the selected days with hours matching the AM/PM option set
  3. Filter with a condition that the Day / hours of the week ARE NOT the options from the “Availabilities” field

This all seems incredibly complicated and I’m convinced there is a better way to do it.

Plus, I run into a ton of problems :

  • I don’t know how to check that a day of the week matches my option set (essentially I can create a condition where “Date 1 > or < to Date 2”, but I can’t find one where “Date 1” = Wednesday for example)
  • Since “Availabilities” is an option set and not a list of date ranges, I can’t add any more “unavailable” events when clients book
  • When creating a “date range” data type for my option set, the field is blank and I’m not sure what format to use to fill in static ranges of hours (without any days)

Do you have any better solution to this problem ?

Thanks a ton :pray: