Filtering by Date

I am trying to find a function that would filter dates by yesterday or 2 days ago if possible. In Java 8 there is a minus() method, in Python there is you can do str(date.today() - timedelta(days=1)), but in ctl2 I see dateAdd() but no dateMinus() or dateSubtract() options. I’m trying to make something like this $in.0.whenCreated > today() - 1||2 days.
Is there a way to subtract days from the today() function?
Thanks

Hi Hesske,
it looks like you would want to take advantage of the dateDiff() function here. The way how this function is designed would determine the filter expression so it would be slightly different from your example though:

dateDiff(today(),$in.0.whenCreated,day) < 2

If you put this piece of CTL code into the Filter component, Clover would calculate the difference between today and the ‘whenCreated’ date and will only output those records where this difference is less than 2 days.
Kind regards,

Thanks Vladimir, this is exactly what I needed.