Versions Compared

Key

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


Understanding the details


ScriptMeaning
var oneDay = 1000*60*60*24;The number of milliseconds in a day
var startDateVariable = #someStartDate.value;Object representing the Studytrax variable
var startDate = startDateVariable.value; JavaScript Date object


An example

var startDate = #AEonsetDate.value;
var endDate = #AEendDate.value;
if (!isNull(startDate.value) && !isNull(endDate.value)) {
var AEdays = (endDate - startDate)/86400000oneDay;
}

Output.write("The AE started on " + startDate.toString() + ", and lasted for " + AEdays + " days.");

...