I have a confiform that I'm trying to add css rules to some fields. I'm having trouble getting the expression correct to make it work.
I have 6 date fields:
- initial start (initStartDate)
- initial end date (initEndDate)
- Option 1 Start Date (opt1StartDate)
- Option 1 End Date (opt1EndDate)
- Option 2 Start Date (opt2StartDate)
- Option 2 End Date (opt2EndDate)
I'm trying to achieve three filters for css rules based on the initEndDate field.
1. if opt1StartDate AND opt2StartDate are empty AND initEndDate is greater than 180 days from Today, then background colour should be green.
2. if opt1StartDate AND opt2StartDate are empty AND initEndDate is less than 180 days from Today, then background colour should be orange
3. if opt1StartDate AND opt2StartDate are empty AND initEndDate is less than or equal to today then background colour should be red
I've tried the following approaches trying both timestamp and number of day values but haven't gotten it right yet. I believe from the docs that datetime intervals need to be done in milliseconds, but unsure if this is also the case for date values.
opt1StartDate:[empty] AND opt2StartDate:[empty] AND initEndDate.subtract(_today):>180
opt1StartDate:[empty] AND opt2StartDate:[empty] AND initEndDate.subtract(_today):>15552000000
opt1StartDate:[empty] AND opt2StartDate:[empty] AND ([entry.initEndDate]-_today):>180
Appreciate any help to identify the issue.
Thanks
Drew