I am trying to use JSON code on SharePoint list - works fine with 2 conditions(green,red) but I am not able to add additional condition, third with yellow...not sure how it should look.
workable:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"txtContent": "@currentField",
"style": {
"background-color": "=if(@currentField >= @now - 7776000000 ,'green', (if(@currentField >= @now - 604800000, '#ffa59b','red'))"
}
}
I am trying to add "yellow now - 4800000"
Update
We need 2 colors - green and red. Red should be for todays date and within range of 30 days from today in the past. Rest in green - both ways - ahead and in the past. Example : Today is the 10.5 that should be in red, 30 days back still in red. Above 30 days in the past Green and Tomorrow continuously green.