Comparing a List of Date Range

I am trying to do a calculation to check if a given date is in a field defined as a List of Date Range. I cannot find a suitable operator to do this. The limitation seems to be that whilst the ‘contains’ operator can check a single line (like ‘first item’) in that array, I cannot find a way to check if the date matches ANY of the entries in that list. Any suggestions?

Hi there, @kenlaji… I have never done what you described, so I would have to work through an example to see exactly how to do it. That being said, you should be able to use the :contains point operator to check each date range in the list to see if the range contains the given date. Have you gone down that path already?

Best…
Mike

Thanks @mikeloc . Yes I have. So when I start referencing the Thing with the list of date ranges, ‘Contains Point’ operator is not available (Contains does not complete, seems to expect something and remains red) When I attempt ‘each item’, the options once again does not have a way of specifying a random point - only start, end or center. A true no code limitation @josh ?

contains
contains_2

This might not help because I don’t know exactly what your setup looks like, but here is an example where I have a field called availability on the User data type, and that field is a list of date ranges. Then, I have a date picker on the page, and I have a repeating group that gets the date ranges from the current user’s availability list where the date range in the list contains the date (point) that has been selected from the date picker.

Thanks very much - that worked! I think not having ‘contains point’ operator on the expected place (in the panel I was talking about above) is a real limitation and I will add that to the Bubble feature requests :slight_smile:

1 Like

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