Question about displaying future and past dates

I’ve tried YouTube and the manual but I’m none the wiser on this…can anyone suggest a way forward?

I want to make payments to Users from my app on the 24th of each month.
I want to create a pop up that appears when a User clicks on their account information that tells them when the next payment run will be and what’s included in it.
On the Pop Up I want to display a “Next Payment Date/Time” as well as a “Previous Payment Date/Time”

This means that, whatever date it currently is, I want the date of the Previous Payment to be the “24th of the previous month” and the next payment date to be the “24th of this or next month”.

How do I go about achieving this?

Would I be better off creating a separate data type for payment dates and times and simply looking up the one I want to refer to (perhaps numbering them for ease?) or is there a clever way of putting the next/previous date into a Text on the popup?

I really don’t know how to go about it so I’d really appreciate some direction.

All the best
Joe

There’s loads of ways you can do this… but I’d probably just show the date of the last payment, and add a month to it for the next payment date…

1 Like

Hi there, @joefarrowsmith… what Adam said is likely the way to go, but if you want to get creative in a text element, here is an expression that would produce the 24th of the previous month.

previous

To get the 24th of the next month, simply change the -1 to 1, and you’d be good to go.

Just food for thought… hope it helps.

Best…
Mike

P.S. if your next question is how did I get the parentheses in there, you have to enable the experimental parentheses feature.

2 Likes

Thank you so much Adam. That makes sense. I feel a bit silly not having thought of this - I think because I haven’t done a payment yet there isn’t a last payment date and I’m easily tripped up with my thinking. So I appreciate this very much!

Mike - Thanks again. I have no idea how one learns this stuff unless you spend forever in Bubble. I’d never have found it and the “change date to” looks very helpful.
I’m going to see which of the two methods works simplest for me. You’ve really helped my learning here. Thank you again.
P.S. - Good pre-empting of my next question. I’ll jump down the “experimental stuff” rabbit hole later. Thanks for the heads up about it.

1 Like