我有一个带有日历视图的SharePoint列表,其中的日期基于标题为ExpirationDate的列.
我想配置日历视图,以使今天到7天后到期日期的项目具有红色背景 colored颜色 .不幸的是,条件格式选项只有一个相对日期,那就是今天.我try 使用条件格式选项来获取基本代码并进行修改,但当我将7天后的静态日期替换为"@NOW+604800000"时,它无法识别该日期.
另外,出于某种原因,我的ExpirationDate列被引用为[$Expation_x0020_Date]--我只能假设这是因为标题中最初有一个空格.
SP生成的代码:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",
"additionalEventClass": {
"operator": ":",
"operands": [
{
"operator": "&&",
"operands": [
{
"operator": ">=",
"operands": [
{
"operator": "Date()",
"operands": [
{
"operator": "toDateString()",
"operands": [
{
"operator": "Date()",
"operands": [
"[$Expiration_x0020_Date]"
]
}
]
}
]
},
{
"operator": "Date()",
"operands": [
{
"operator": "toDateString()",
"operands": [
{
"operator": "Date()",
"operands": [
"@now"
]
}
]
}
]
}
]
},
{
"operator": "<=",
"operands": [
{
"operator": "Date()",
"operands": [
{
"operator": "toDateString()",
"operands": [
{
"operator": "Date()",
"operands": [
"[$Expiration_x0020_Date]"
]
}
]
}
]
},
{
"operator": "Date()",
"operands": [
{
"operator": "toDateString()",
"operands": [
{
"operator": "Date()",
"operands": [
"Thu Sep 14 2023"
]
}
]
}
]
}
]
}
]
},
"=if(@isSelected == true, 'sp-css-color-WhiteFont sp-css-backgroundColor-BgDarkRed' , 'sp-css-backgroundColor-BgCoral sp-css-color-CoralFont')",
""
]
}
}
就像我说的,试图用一个相对的日期来划分指定的日期,没有骰子.