I am trying to set custom formatting for date field and followed the guide here: https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/column-formatting#apply-conditional-formatting.
I have written the code below, but it doesn't respect multiple if conditions - none of the specified colors work unfortunately.
Perhaps someone could advice, what could be the issue?
{
"$schema":"https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType":"div",
"attributes":{
"class":"=if(@currentField >= @now + 604800000,'#FF6347', if(@currentField >= @now + 1209600000, '#FFD700', if(@currentfield >= @now + 1814400000, '#32CD32', '')))"
},
"children":[
{
"elmType":"span",
"style":{
"display":"inline-block",
"padding":"0 4px"
},
"attributes":{
"iconName":"=if(@currentField >= @now + 1814400000,'Error', '')"
}
},
{
"elmType":"span",
"txtContent":"@currentField"
}
]
}