So, basically what I am doing is bookings get created on a calendar on an even timeslot like xx:30 or xx:00. They are created on the hour or half-hour.
In each booking, there is a user assigned. On each user, there is a list of date ranges which is taken from any bookings assigned to them.
For example, I create a booking from 10:00 → 12:00 then that date range is added to whichever user is chosen.
When I edit bookings, I have a dropdown with a list of users filtered by whether the current booking range overlaps with their list of booking ranges.
The problem is, I want to be able to create bookings back to back, like 10:00 - 12:00, 12:00 - 13:00, whatever.
So, technically the 12:00 end from the first booking overlaps with the 12:00 start of the second booking, so when I create that booking I am unable to choose the same user as was chosen in the first one.
I still want to be create the bookings on an even hour/half hour, but be able to have the user show up in the list even if they’re back to back.
How the dropdown filter is now:
Essentially what I was thinking for getting them to show up in the list was to use the filter to take the date ranges and add 1 minute to the start, and subtract 1 minute from the end.
For example
Actual booking start: 28 Aug 2021 10:00
Check overlap: 28 Aug 2021 10:01
Actual booking end: 28 Aug 2021 12:00
check overlap: 28 Aug 2021 11:59
So that when I create a booking starting at 12, the dropdown will “think” for lack of a better word that the user’s last booking ends at 11:59, not 12:00, so that technically they won’t overlap.
The expression doesn’t seem to allow me to manipulate the date ranges in this way though. very frustrating. Anyone know?