Filter out a range of dates in a RG

I’m building a filtering workflow for users to filter a list of ‘events’ in a RG. Each event has a field for start date/time and an end date/time.

In the filtering UI, the user is able to select the days and times of the week that they are not available. For example: Wednesdays 5pm - 8pm, Fridays 3pm - 5pm.

The RG should filter its results to not include any events that occur between the times of 5-8pm on Wednesdays nor 3-5pm on Fridays in the case of my example above.

How might you set up your DB and constrain the RG in order to allow this type of filtering? I have been toying with the idea of saving the ‘unavilable times’ as a list of date ranges and then using the ‘overlaps with’ operator in the RG to filter out dates that overlap. However I’m not sure how to make it filter out “ALL Wednesdays 5-8pm and ALL Fridays 3-5pm.” Quite a challenge!

Appreciate any help!

This topic was automatically closed after 70 days. New replies are no longer allowed.