Forum Academy Marketplace Showcase Pricing Features

Missing filter options on date/time picker?

So, I’m trying to get a basic scheduler app setup.

I have teachers, that have a list of date/time ranges. These ranges correspond to when they are available to give lessons. For example. Andrew is available Mar 15th 6pm until Mar 15th 10pm.

I have a repeating group with a list of all of available date/time ranges. I also have a FROM date/time picker input and a TO date/time picker. This is so a student can enter date/time range that they are available to be compared against the teacher’s availability.

I set a filter on the repeating group to only show available date/time ranges that overlap with the one the student has input. But, because lessons are 1 hour long, I need to modify the filter to make sure it only displays time ranges that overlap by at least 1 hour at the start or end of the range.

This is where I’m having the problem. I want to enter:

Constraint = This date range’s :start +(hours): 1 <-range-> This date range’s :end +(hours): -1 overlaps with Date Picker TO <-range-> Date Picker FROM

However, as you can see, it doesn’t give me the option to do :end +(hours) -1

Is this a bug, or by design?

1 Like

I’m adding a link to editor to make it easier for people to help:

Right, the issue you’re hitting here is that the composer doesn’t handle parentheses, and evaluates from the left to the right. So the dropdown you’re showing is showing options for the created range, not the end time. A workaround is to use a custom state on an element and store the data you need to modify there, and then use that data.

1 Like

Thanks @emmanuel! That makes a lot of sense.

Custom states are still something I’m trying to get my head around… but now I have the incentive to learn.

1 Like