Bubble.io Date filter: This Week
Learn how to filter data by the current week in Bubble.io for your no-code SaaS application.
Filter by current week: Discover the secrets to mastering date formatting in Bubble for precise weekly filtering.
Rounding down to Sunday or Monday: Learn how to manipulate dates and create flexible conditional statements for your Bubble app's calendar features.
Inelegant but effective: Explore advanced techniques for handling complex date scenarios in your no-code SaaS application.
Filtering by the Current Week in Bubble
In this Bubble tutorial video, I'm going to show you how you can filter by the current week on a list of dates. Now, I've been putting off doing weeks because to be honest, they're a little bit more tricky and have more to be considered than filtering by last 30 days or last month or even like the current year. So let me just begin by building an expression here. But before I do that, if you're learning Bubble, if you're building a no code SAS application, then click the link down in the description because we've got hundreds of Bubble tutorial videos just like this one and we've got a community of Bubble app builders ready for you to join.
Building the Expression for Current Week
So let's begin by building an expression here. So we need to get the start of this week. Now, first hurdle, what do we mean by that? Well, let's see what Bubble means by that by saying rounded down to week. So that's saying May 5th. Now, let me add a little bit more detail here so that it's clearer. We'll say formatted as... there we go. Because the big question here is, does it round down to Monday or does it round down to Sunday? So there we go. It rounds down to Sunday. So when we say round down to week, it is rounding us down to midnight on the Sunday.
Adjusting for Monday Start
Now, if you can work with that limitation in your Bubble app, then that's going to make things a lot easier. But of course we can add a little bit more further wiggle room here of... Whoops, didn't mean to delete that. Picking in here, taking this back. We could say rounded down to week plus one day. Let's see what that gets us. So there we go. Now... let's just add in the formatting. So that's really clear. So now we do get Monday.
Considering Edge Cases
Just be aware of how this could behave because what if you were on... Okay, so if you were on midday Sunday, you would round down and that would be the start of Sunday and then you could add one day. So then actually that's the Monday in the future even though the expression you've built here is intended to be the Monday in the past. So if you've got a better solution, leave a comment down below. I'd love to hear it.
Using Conditionals for Sunday
The way around that I found before is to effectively use a conditional and let me just give you a little point on that. So let's take this expression here and add it in as a constraint. So we'd say date is equal to or less than... If I just remove the formatting. Okay, so that's going to be rounded down to week plus one day, but it doesn't work if it's a Sunday.
Handling Sunday as a Special Case
So what you could do, and I think that this is fairly inelegant, is to say current date time. So basically you do a different thing if it's a Sunday. So we say current date time extract day. Now Sunday is a zero because it's an index value of the week day starting on Sunday. So Sunday is zero, Monday is one, all the way through to Saturday being six. So we're saying if it's a Sunday, we change the data source. That's what I mean. It's inelegant. And I'd love there to be a better solution.
Alternative Approach for Monday Start
If you wanted to start your week on a Monday. So this time, so if it's Sunday mid-day, we want to probably minus a day and then round it down. And then plus a day. I think so. So we say days minus one day. So that's going to take us into Saturday, which now means that if we round down to week, we are the previous Sunday. And then if we add a day, we get to the previous Monday. Like I say, it's inelegant. Let me know if there is a better solution to working with weeks. I'd love to hear it.
Ready to Transform Your App Idea into Reality?
Access 3 courses, 400+ tutorials, and a vibrant community to support every step of your app-building journey.
Start building with total confidence
No more delays. With 30+ hours of expert content, you’ll have the insights needed to build effectively.
Find every solution in one place
No more searching across platforms for tutorials. Our bundle has everything you need, with 400+ videos covering every feature and technique.
Dive deep into every detail
Get beyond the basics with comprehensive, in-depth courses & no code tutorials that empower you to create a feature-rich, professional app.
Valued at $80
Valued at $85
Valued at $30
Valued at $110
Valued at $45
14-Day Money-Back Guarantee
We’re confident this bundle will transform your app development journey. But if you’re not satisfied within 14 days, we’ll refund your full investment—no questions asked.
Can't find what you're looking for?
Search our 300+ Bubble tutorial videos. Start learning no code today!
Frequently Asked Questions
Find answers to common questions about our courses, tutorials & content.
Not at all. Our courses are designed for beginners and guide you step-by-step in using Bubble to build powerful web apps—no coding required.
Forever. You’ll get lifetime access, so you can learn at your own pace and revisit materials anytime.
Our supportive community is here to help. Ask questions, get feedback, and learn from fellow no-coders who’ve been where you are now.
Absolutely. If you’re not satisfied within 14 days, just reach out, and we’ll issue a full refund. We stand by the value of our bundle.
Yes, this is a special limited-time offer. The regular price is $350, so take advantage of the discount while it lasts!