I'm using a SharePoint List to track annual training requirements. I would like for the column to display different colors based on the date they have entered into the field relative to when they need to accomplish the training again. So, what I'm trying to accomplish:
365 or more = red
<365 = green
304-364 (60 days till expiration) = yellow
Date is displayed in white regardless of above
Here's what I have so far (lifted from another answer and modified slightly):
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"style": {
"background-color": "=if(@currentField >= @now - 31449600000 ,'green', (if(@currentField > @now - 31536000000, '#F07440','red'))"
}
}
