I am trying to build a room booking system. In my DB I have a “room”-thing, which contains a list of bookings, each of which consists of a guest (User) and a date range.
For the booking process, I have a Date Picker element where users can select when they want to book the room. Now to check if the room is available, as far as I know, I need to output if the date range selected by the user overlaps with one of the date ranges of the bookings of the room.
How can I perform this “date range does/does not overlapt with at least one date range from the list of bookings” operation? I can only select “overlaps with first/last etc. element”, but not "overlaps with any element.
Does my architecture make sense at all, or is there a better way to set up such a room booking system?
Late reply but searching for a similar issue and most of the threads seem overly complicated. I think maybe bubble has many ways to solve some problems but here is the way I approaching solving mine…
Do a search for the thing you want, this results in a list.
Use the :minus list option and choose Do a search for.
Choose the Things you need to check, eg the list of existing bookings
Make sure you have a “date range” field in your db for those things, eg the booking date range. You have a “date interval” type and I think this should be “date range”.
Chose the date range field and “overlaps with” and choose eg start.value <!-range-> end.value fields for your project.
This results in a search for all, minus the list of search items that you found overlapping the dates.