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.
Example:
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.
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.
@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?
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.