Timer

Forums General discussion Timer

Viewing 3 reply threads
  • Author
    Posts
    • #13750
      Iain Munro
      Participant

      Hi There

      I know this is an old age problem, but was looking to see if there was an update.

      I have two columns:

      Date Received
      Date Due

      I need another column that will do a countdown in realtime (not a solution that will required data to be update) to show the days remaining, such as 10 days left.

      Any help would be appreciated.

      Iain

      • This topic was modified 5 years, 1 month ago by Iain Munro.
    • #13766
      Alexander Bautz
      Keymaster

      Hi,
      You can create a calculated column with this formula:

      ="<img src='/_layouts/images/blank.gif' onload='var a = new Date("&YEAR(DueDate)&","&(MONTH(DueDate)-1)&","&DAY(DueDate)&","&HOUR(DueDate)&");var b = new Date();var c = (a-b) / (1000*60*60*24);this.outerHTML = c<0?""<span style=color:red>OVERDUE</span>"":c<1?parseInt(c*24,10)+(c*24<2?"" hour"":"" hours""):parseInt(c,10)+(c<2?"" day"":"" days"")'>"

      Change “DueDate” to match your field name.

      You must set the “The data type returned from this formula is” to “Number (1, 1.0, 100)”. This renders the calculated value as HTML in list view, and this “trick” works in most list views in SharePoint, but will not work in the “New experience” list views in Office 365.

      Please note that this column cannot be filtered as the filter value will be the HTML string.

      The output will be as show in the attachment.

      Hope you can use it,
      Alexander

    • #13776
      Iain Munro
      Participant

      Excellent – many thanks Alexander. Saved the day again.

      Iain

    • #13789
      Alexander Bautz
      Keymaster

      I’m glad it worked.

      Alexander

Viewing 3 reply threads
  • You must be logged in to reply to this topic.