Check if date is older than the start of current week

Everybody knows there is a way to subtract days. by + day (-3).

But what if I wanted to make a condition that will always check if the current date is older than this week (meaning it is before the Monday 00:00:01 AM this week).
I have an idea how to do it with buffering some variables, but can it be done with one expression condition?
As it leads me to go with -current date statement which is not allowed in bubble.

Is it possible this should do the trick?
Date X < Current date/time:rounded down to week
As I am afraid of this American week beginning approach.

To check if a date is older than the start of the current week, just use:

Date < current date/time: rounded down to week (in whatever timezone you’re working with).

Note that in Bubble (as in Javascript) the week starts on Sunday, so rounding any Date down to week will change the date to the start of the most recent previous Sunday (or, if the date is a Sunday, then the start of that day).

If you want to use Monday as the week start instead, just add 1 Day.

note: that will only work Monday to Saturday - it will be incorrect for Sundays - so you’ll have to add some additional logic to deal with dates which are Sundays (i.e. deduct 6 days rather than add 1).

So, to do it in a single expression just use:

dateX < current date/time: rounded down to week + days (dateX: extract day is 0: format as number)

where the number for yes is -6 and the number for no is 1

2 Likes

Thanks. Realized this myself after a while. Let’s leave it a good solution for the community. Always great advice.

1 Like