Can you check whether a day of the week is contained within a date range?


I have two date pickers to create a start and end date of a date range.

I also have a data type containing a list of users and the days of the week that the user is unavailable.

I would like to filter a repeating group of users to only show users who are available for all days of the week within the selected date range.

User A is not available on a Monday.
If the selected date range contains a Monday then the user will not appear in the list. If the selected date range does not contain a Monday then the user will appear in the list.

Is this possible? Struggling to see whether there is a syntax that lets me compare a date range with a list of days of the week.

Any pointers greatly appreciated. Many thanks

It’s possible!

You can use “format as” with the custom option using the settings in my screenshot to get the day of the week of any date. Eg., will return “Saturday” with this format. Hopefully you can get the rest of the way on your own from there.


I did it exactly like @Zaque wrote. Just want to add the information that I stored a certain day in the database for availability.

I.e when user generates a new availablity for Monday → store Arbitrary Date: Monday 22/03/21

With this solution you can extract only the day afterwards and its also multilangual!

@Zaque @daviddr17 many thanks to both of you for taking the time to reply.

The bit I am still stuck with is how to create the list of days to compare to the unavailable days in a filter. I am trying to filter a list of users and am struggling to create the list of days of the week based on the start and end date from date pickers.

I was hoping to be able to create a filter like:
unavailable day is not contained within <date range’s list of days>
but can’t seem to access the date pickers for this type of filter to create the list of days.

Any pointers on how to create the list of days which fall within the user defined date range?

Many thanks

1 Like

This is an important thread. There is a plugin that does this exact thing. It’s awesome. Hard to setup but dope.

I’d like to see it possible in vanillaBubble

@karend do you want to check if a date range contains a certain date (and a time slot is available at this certain date)

or do you want to achieve to check the following:

Availabilty of user:

Monday: 7-9, 4-6
Tuesday: 8-10, 12-14
(every week the same time slot, but adjustable)

then a customer makes an appointment on Tuesday 8-9 at a certain date and only on this date at this time range the user is not available anymore?

Is it Toolbox that you are using? Managed to set that up for list of dates now but not yet for a list of the days of the week.

The complexity of my scenario is I am trying to check availability for a range i.e. I want to check if someone is available between date a and date b. If someone doesn’t is unavailable on Friday then they would not appear in the list of users if the selected date range is Mon to Fri but they would appear if the selected date range is Mon to Thu

I would suggest you to take a look at the list shifter plugin. It lets you iterate a workflow on a list of things.

In your usecase you have a list of date ranges and check day by day the availability.

You can set a custom state list of yes/no to a group and set the states depending on availability.

The result would be:

Monday → not available → custom state: no
Tuesday → available → custom state: no, yes

Because a list of states holds the same value only once, this list won’t change anymore. It doesn’t matter anymore if another yes or no will be added because the maximum of a custom state of yes and nos is : yes,no

Now you can check if this list contains yes. If so-> available, displayed

If Custom state doesn’t contain a yes → not available, not displayed

@keith has done some really good explanation videos on how to deal with the list shifter.

I would say that’s the easiest way to it.


Thanks so much for this :+1: Will definitely give this a go.

1 Like

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