Bubble.io Date Filter: Last 30 days
Learn how to filter a list of dates to only return dates in the last 30 days in your Bubble.io app with this step-by-step tutorial.
Master Bubble date filtering: Learn how to create a dynamic 30-day filter for your Bubble.io app's calendar or events list!
Unlock powerful date expressions: Discover the secrets of rounding down dates and creating precise time ranges in your no-code SaaS app.
Boost your Bubble skills: Transform your app's date handling with our step-by-step guide to filtering the last 30 days.
Working with Dates in Bubble
Working with dates in Bubble can be a little bit tricky so here's my Bubble tutorial video showing you how we can filter a list of dates to only return dates in the last 30 days and if you're building a no code SaaS app with Bubble then click the link in the description because we've got hundreds of videos just like this one to help accelerate your Bubble app development journey.
Creating an Expression for the Last 30 Days
Right let's look at building an expression that targets the last 30 days. So I'm going to do it in this text field initially because then you can see each step in action. So we can say current date time and we can say days and it says plus days but you can use a minus operator in here.
Understanding the Initial Expression
This isn't quite it but I'm going to show you what this looks like because it's currently May 8th 11:30. Notice it is relative to time zone and so now we go back to April 8th which would be 30 days ago but it's saying 11:30 which is going to miss any events that happened on April 8th 10:30 and when a user is thinking last 30 days they probably want all of April 8th.
Refining the Expression
So we go back in here and we can just say and add to the end of it round it down to day because now if we look in the expression we should have April 8th midnight right at the start of April 8th.
Applying the Expression to Filter Data
So if we wanted to filter our calendar by that or it could be a repeating group just anything with date data like events we can say the start date that we want to have the start of our date sandwich is going to be our expression of current date time days minus 30 rounded down to day.
Handling Future Events
Okay and then so that we don't accidentally get any events in the future for example we could have the next 30 days but we wouldn't want that included. Well you've got to make a decision whether the last 30 days includes the day or not but effectively you could do something like this where is date is less than current date time.
Refining the End Date Expression
Now that's not perfect because if we wanted our last 30 days expression to include events that are in the future but are on today's date we're going to miss them here. So instead we could say days plus one rounded down to day.
Explaining the Final Expression
So what that's going to do is take my current day which is May 8th. Oh no I've days plus one one rounded down there we go. So that's going to take my current date which is May 8th plus one which would make May 9th at 11:30 and then round it down so that's going to be the midnight of May 9th and because we're using a less than and not a less than or equal to operator here it's going to be the fraction before the start of May 9th.
Conclusion
So that's going to work and that's how you can filter by the last 30 days in your Bubble app.
Get the Complete Bundle for Just $99
Access 3 courses, 390+ 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 390+ 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.
Save over 70%!
Valued at $80
Valued at $85
Valued at $30
Valued at $110
Valued at $45
Can't find what you're looking for?
Search our 300+ Bubble tutorial videos. Start learning no code today!
Have questions?
We have answers!
Find answers to common questions about our membership plans, programs, and more.
We're here to help you launch your no code SaaS. Reach out to the team and we'll double check our vast library for useful content. We'll advise you on how we'd tackle the same problem and there's a good chance we'll record the video to help the wider community.
As a Planet No Code member, you'll receive a discount on our Bubble coaching sessions. Monthly members receive a 10% discount, while Annual members receive a 17.5% discount. To redeem your discount, simply log into your account and book a coaching session through our platform.
Our 8-week intensive mentorship program is designed to provide personalized guidance and support to help you accelerate your startup journey. You'll be matched with a startup expert who will work with you one-on-one to set goals, overcome challenges, and make rapid progress.
To apply for the Mastery Program, simply click the "Request Invitation" button on our pricing page and fill out the application form. Our team will review your application and schedule a call with you to discuss your goals and determine if the program is a good fit for your needs.
We accept all major credit cards, including Visa, Mastercard, American Express, and Discover.
While we don't offer a free trial, we do provide a 14-day money-back guarantee. If you're not completely satisfied with your membership within the first 14 days, simply contact our support team, and we'll issue a full refund.