Forum Discussion

kobi1991's avatar
kobi1991
Copper Contributor
Jan 11, 2023

Countdown to due date in SharePoint 365 list

Hello!

 

I'm using a SharePoint 365 list as an action tracker. My list contains the due date. I would like to add a column that contains a count of days remaining to the due date. 

 

I tried the datedif function together with 'TODAY', but it does not work. I guess I need to have an additional column with today's date to use this one? Was hoping to create it using workflows but these were retired in SharePoint 365. Is there a way to do it differently?

 

Would much appreciate your help.  

 

  • SvenSieverding's avatar
    SvenSieverding
    Bronze Contributor

    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

Resources