Filtering Repeating Groups by Date in Bubble
In this Bubble tutorial video, I'm going to show you how you can filter a repeating group using dates to only show events occurring on today's date. But before I do that, did you know that we've got over 100 Bubble tutorial videos, some of which you cannot find on YouTube, exclusive on our website planetnoko.com, and currently you can access all of them for a year for just $99.
Setting Up the Database
Let's get back to our repeating group. So I've created three events in my database. They just have a label and a date field and you can see them in my calendar and today's date of recording is August the 3rd. And so how do I set up this repeating group to only show events happening on August the 3rd? Well, let me show you.
Configuring the Repeating Group
So I'm going to go on to my repeating group. At the moment, I've just got my event data type and I've got data source. I'm going to add in a constraint. And so I'm going to say date is equal to or greater than current time date rounded down to day. And so that's saying is the date of this event greater than midnight at the start of today? Let's add in a second constraint.
Adding Time Constraints
This time we say date is less than, we say current date time and this time we round down to day again. But now we add, or we can add days or we can add 24 hours. Now this is technically going to make a difference if your current time zone is going to go through a time zone shift in the next 24 hours. So that's something to bear in mind but you can achieve it either way. In this case, I'm just going to say days 1.
Finalizing the Filter
So now I say both of these are the and statements. So is it greater than midnight at the start of today but less than the start of today plus one day? Okay, let's check out the preview to see if that has worked. So we should just say walk the dog.
Conclusion
Okay, and there you go. That's how to add in date constraints to a repeating group. In particular, how to filter down a list of events to only show events that are occurring today.