Forum Discussion
nshaw75
Jun 10, 2024Brass Contributor
Formatting Dates
In my SharePoint list I have a column of review dates. I was wanting to create a formatting formula which, I have tried using Co-Pilot to various levels of success I want the standard DD-MM-YY in the...
- Jun 12, 2024
nshaw75 format your date column in advanced mode with the following JSON:
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "txtContent": "@currentField", "style": { "background-color": "=if(Number(@currentField) == 0, '', if(@currentField < @now, 'red', if(@currentField >= @now && @currentField < addDays(@now, 30), '#ffe577','white')))", "color": "=if(Number(@currentField) == 0, '', if(@currentField < @now, 'white', if(@currentField >= @now && @currentField < addDays(@now, 30), 'red','black')))", "font-weight": "=if(@currentField < @now, 'bold', 'normal')", "padding-left": "6px" } }Rob
Los Gallardos
Microsoft Power Automate Community Super User.
Principal Consultant, SharePoint and Power Platform WSP Global (and classic 1967 Morris Traveller driver)
Rob_Elliott
Jun 12, 2024Silver Contributor
nshaw75 format your date column in advanced mode with the following JSON:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"txtContent": "@currentField",
"style": {
"background-color": "=if(Number(@currentField) == 0, '', if(@currentField < @now, 'red', if(@currentField >= @now && @currentField < addDays(@now, 30), '#ffe577','white')))",
"color": "=if(Number(@currentField) == 0, '', if(@currentField < @now, 'white', if(@currentField >= @now && @currentField < addDays(@now, 30), 'red','black')))",
"font-weight": "=if(@currentField < @now, 'bold', 'normal')",
"padding-left": "6px"
}
}
Rob
Los Gallardos
Microsoft Power Automate Community Super User.
Principal Consultant, SharePoint and Power Platform WSP Global (and classic 1967 Morris Traveller driver)
nshaw75
Jun 12, 2024Brass Contributor
Thanks very much for the help. 😀