Forum Discussion
Countdown to due date in SharePoint 365 list
- Jan 11, 2023
Hi kobi1991 ,
sure. This is SharePoint Json list formatting code that formats a column.
https://learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/column-formatting
Got to you SharePoint View, select the header of your "Due Date" column and select "Column Settings->Format this Column"
Copy the Json Code here
You don't have to change the formula, as "@currentField" references to the selected Column.
Best Regards,
Sven
kobi1991
You could apply JSON Formatting:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"txtContent": "=floor((Number(@currentField)-Number(Date((getMonth(@now)+1)+'.'+getDate(@now)+'.'+getYear(@now))))/(60*60*24*1000))+' day(s) remaining'"
}
Best Regards,
Sven
- kobi1991Jan 11, 2023Copper Contributor
Thank you, Sven! Apologies but I'm completely new at this - could you please explain where in the code I should put my 'due date' column?
Karolina
- SvenSieverdingJan 11, 2023Bronze Contributor
Hi kobi1991 ,
sure. This is SharePoint Json list formatting code that formats a column.
https://learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/column-formatting
Got to you SharePoint View, select the header of your "Due Date" column and select "Column Settings->Format this Column"
Copy the Json Code here
You don't have to change the formula, as "@currentField" references to the selected Column.
Best Regards,
Sven- faric1311Jun 22, 2023Copper Contributor
Hi SvenSieverding,
I have a question about your json code, i have tried to apply the code into my list but all the dates that have past due displays for example "-29 days", is there any code that could make all the dates that have past due displays "0 days"
Thanks
Best Regards,
Faric