Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

Use a calculated variable to display a categorical amount of time between two dates of interest. 

How To

Table:

 The final table could look like the below image. In this example, the column of time categories designate the number of weeks before a phone call is due.

...

function diffInDaysUTC (a, b)
{
var milliSecondsPerDay = 1000 * 3600 * 24;
var baselineDate = Date.UTC(a.getFullYear(), a.getMonth(), a.getDate());
var followUpDate = Date.UTC(ab.getFullYear(), ab.getMonth(), ab.getDate());
return Math.floor((baselineDate - followUpDate) / milliSecondsPerDay);
}

...