Optimizing Filtering of Open Venues Around the User on Bubble

Introduction:

Hello Bubble community! :rocket: I’m currently developing an app that assists users in finding open venues nearby. I’ve stumbled upon a unique filtering challenge with opening hours, and I’m seeking your insights.

Description of the Challenge:

Variable Opening Hours:

  • Some venues have the peculiarity of having two separate opening periods within a single day. For example, they open in the morning, close early afternoon, then reopen in the evening.
  • In my database, these hours are structured using fields like OuvLun, FerLun for the first slot and OuvLun1, FerLun1 for the second.

Daily Variability:

  • The opening hours can differ from one day to another. Right now, I’m focusing on Mondays (represented by 0).

:camera_flash: Here’s a screenshot showcasing how I’ve currently set up my filtering for Mondays.

Seeking Advice:
I’m wondering if there’s a simpler or more efficient way to handle this filtering. Manually handling every time slot for each day seems cumbersome, and I’m convinced Bubble has a sleeker solution.
Would it also be possible to copy-paste this entire block for other days?
Do any of you have suggestions or tricks to enhance this? Your expertise would be immensely valuable!

Thank you all for your time and insights! :star2:

create a data type that is called ‘operating hours’

put fields:

venue
day
open
close

This means a single venue will have a minimum of 7 entries (each day of week) and some may have more than that (venues with more than one range of hours per day)

Then on the venue data type put a field that is a list of operating hours

On filter look at the venues list of operating hours each items filtered by day and check against the open and close

1 Like

Thank you really much boston85719, you saved me lot of time !

1 Like

If you ever see an expression even half that size there’s a 99% chance there’s an easier way to accomplish what you’re trying to do.

2 Likes

And it’s an advanced filter, too… I’m surprised OP’s computer hasn’t burst into flames.

3 Likes

Yes, after wrote the “Monday” I questioned myself :joy: It’s my first app

1 Like