DMXzone Server Data Formatter Support Product Page

How do I check if one date comes before another?

Asked 04 Feb 2022 15:14:11
1
has this question
04 Feb 2022 15:14:11 Bruce Wilkie posted:
I have a database record with two date fields which I'm displaying on a page. I want to show a warning on the page if one of those dates is the same as or earlier than the other.

I tried using dateDiff in Server Connect by setting a value to {{interest_deadline.dateDiff('days', submission_deadline)}} but it always returns a positive value, literally giving the number of days between two dates no matter which one comes first.

So how can I check if one date comes before another?

Replies

Replied 07 Feb 2022 06:04:05
07 Feb 2022 06:04:05 Teodor Kuduschiev replied:
Hello Bruce,
Have you tried checking if one of the dates is greater than the other? Like {{date1 > date2}} ?

Reply to this topic