Avatar

Correct answer by
Community Advisor

Hi,

 

The JS is:

 

new Date() - new Date(ctx.vars.OfferDate)

 

 

Be aware that you're comparing 2 clocks here- the one on the db server and the one on the app server.

A more consistent approach would be to do the math on the db: DaysAgo(@Offer_Date) or whichever resolution is desired.

 

Thanks,

-Jon

View solution in original post