[New Feature] Date and Number Range support

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

  1. define such a field on a type
  2. 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.

This will make building such systems much more intuitive and straightforward than using two date fields, etc.

38 Likes

Neat, thanks for the update!

This feature will definitely come in handy! :smiley:

Fantastic. Perfect for booking features.

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.

@emmanuel A couple of issues …

I have raised a bug with setting up a thing with a daterange in the field type, it hangs the Data View.
Not sure …

…makes a lot of sense … lose the “than” ?

Using Max/Min as “end/start” is quite confusing.

And as above… doesn’t work in a Dropdown unless you show either the Start Or End.

2 Likes

Hi @emmanuel. Thanks for the feature

  1. 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:

  2. Another scenario. What if we have the case like that:
    a. type= rooms
    b. type= reservations

We create a reservation that has:

  1. 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)

Hi Nigel

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:

The data i can see is only, reservations. Booked_dates - which is date range type, is empty

We don’t support the search operations on a list of ranges.

What about this scenario?

Another scenario. What if we have the case like that:
a. type= rooms
b. type= reservations

We create a reservation that has:

  1. 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)
1 Like

Thanks for adding this! Very useful.

P

can this also be used for time ranges?

4 Likes

@NigelG can you maybe think a workaround? Thanks

So basically … “Are there any free rooms on these dates in this hotel” use case ?

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.

6 Likes

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.

Hey

Please check, @NigelGs aproach. That’s the workaround that works. I have just tested it and its ok

regards

2 Likes

@omidv28 did you read Emmanuel’s post?

NigelG’s workaround seems to be the solution to go with right now.

1 Like

@jonaspalmqvist @cm1 thanks guys! so silly of me to not notice that, thanks again

We don’t support searches on list of ranges (that’s a complex database thing operation, we’ll add that at some point but not immediately).

1 Like