We’ve announced that we were working on this a few days ago. We’ve added two data types to Bubble and search support for them. You can define a date range (defined with 2 dates) and a number range. This will be especially useful if you want to build a booking system a la Airbnb, etc.
To define a date range, you should
define such a field on a type
use two dates (for instance 2 inputs), and do this
Then to perform some searches, you can search for entries whose range are contained, contain, overlap with another range. Or contain a given date, etc.
Funny, I didn’t even know this was new and I have been struggling with it all day. So not working, nor does it seem intuitive. I don’t know if it is because I am attempting to use it with a simple dropdown menu or what.
Not knowing this was a new thing, I created a thread here this morning on the forum with explanations and screens.
I know, it did look like this should work in your case and can see why you picked < range > in your dropdown as it seemed like what you wanted. (although you had specified Date Interval in the type).
However a list of date ranges … would be just that … a list of “1/1/2016 - 2/2/2016” etc (although you can’t actually display a date range in a Dropdown you must pick the start or end date) .
What you needed was a list of Dates which is quite hard to generate.
What if we have a list of date ranges? One hotel rooms is booked for a few date ranges.
If i set the date rage type as list then i get 2 options when performing search:
Another scenario. What if we have the case like that:
a. type= rooms
b. type= reservations
We create a reservation that has:
Create new thing - reservation
Checkin = checking inputs value
Checkout = checkout inputs value
Daterange = checking inputs value range checkout inputs value
room= repeating groups selected room
So
Each reservation, has a date range. Each room has multiple reservations. How can we perform the search?
Do a search for: rooms who’s reservartions daterange is not contained by checkin-checkout range (user input)
Same here for this: “setting up a thing with a daterange in the field type, it hangs the Data View.”
Also i m not able to see the data.
And i have a field booked_dates in room type and have this workflow:
Another scenario. What if we have the case like that:
a. type= rooms
b. type= reservations
We create a reservation that has:
Create new thing - reservation
Checkin = checking inputs value
Checkout = checkout inputs value
Daterange = checking inputs value range checkout inputs value
room= repeating groups selected room
So
Each reservation, has a date range. Each room has multiple reservations. How can we perform the search?
Do a search for: rooms who’s reservartions daterange is not contained by checkin-checkout range (user input)
Right… this was a bit of a brain ache but have sort of got there…
What I don’t think you can do is say “Show me all the rooms that don’t have bookings that overlap with these dates”.
You need to look at it the other way round, and say “Show me the rooms that are not in the list of rooms that have bookings that overlap with these dates”.
There seems to be a bit of a problem with doing a filter on a count (will raise a bug). However …
If you have a Room table.
With a List of Bookings with a Date Range…
Then you can put a condition in a cell that changes this cell (i.e. disables a “Book This” button) if this room has ANY booking that overlaps with the start and end date.
hey guys there seems to be a bit of bug or minor glitch and i can’t seem to make any sense of it. It seems like i can’t search for one of the fields, called “Unavailable Hours/Date” in my custom DB called “Listing” which is a list of date ranges. id appreciate any help thanks again. Let me know if the pictures aren’t as descriptive.