Dates comparison operator greater then or equal

Hey everyone!

I suppose this is more of a feature request. Recently I noticed that the date comparison operators doesn’t offer greater then or equal to and it’s sister operator.

This would be tremendously useful if, for example, I want to compare two dates and know if they’re the same.

Is this by design or somebody forgot about it?

Yeah, it’s annoying…

There is no , or even = for dates (actually, there is if it’s a search constraint, but not for general expressions).

No idea why (it seems like an arbitrary design choice by Bubble)… but the simplest workaround is to extract the unix from both dates - then you can compare the 2 any way you like.

e.g.

(DateA: extract unix) ≤ (DateB: extract unix)

or

(DateA: extract unix) = (DateB: extract unix)

2 Likes

I don’t know if it’s relevant to your use case, but I just wanted to note (in case you’re not already aware) that the above is possible with the equals rounded down to operator - at least with minute-level resolution.

While timestamp comparisons can be handy (as Adam points out), millisecond precision is oftentimes not desirable. That’s where rounded down to and equals rounded down to come in. They offer more practical date comparisons for many real-world scenarios. The latter, for instance, if rounded down to day, will return true for two different Bubble date values representing different times on the same day.

-Steve

1 Like

This topic was automatically closed after 14 days. New replies are no longer allowed.