Limited Time Offer: Watch All Our Bubble Tutorial Videos for Only $99 per Year!

Bubble.io Date Filter: Last Month

Learn how to filter a list of dates to only show entries from last month in your Bubble.io app with this tutorial.

In this Bubble tutorial video, I'm going to show you how we can filter a list of dates to only show entries in our database where a date field is last month. But before I do that, if you're building a Bubble app, you're building a no code SaaS application. Click the link down in the description because we've got hundreds of Bubble tutorial videos just like this one.

Building an Expression for Last Month

So yeah, last month I'm going to begin by building an expression in a text field here because that's going to just show you what's going on behind the scenes. So we need to sandwich a date field between a start date and an end date.

The start date of last month, we would arrive there by going something like current date, time, month, add months minus one month. So today's May 8. That's going to take us to April 8. Then we need to round it down to month. Notice that this is all time zone relevant relative time zone relative. So let's preview that. So we should hopefully see April 1. There we go. Midnight April 1.

Filtering Events or Calendar for Last Month

So on our events or our calendar, we can say date is greater than and let's get our April 1 expression in their current date. Time, month plus months minus one, rounded down to month.

Okay, but now what if we've got events in May, my current month? So we would say date come back is less than now. We need the start of the current month. Well, I think you can guess how we get there. So we say current date time rounded down to month.

Okay, there you go. That's how you can target last month in Bubble with date filters and date constraints.

Latest videos

lockcrossmenu