Author Topic: Date calculation  (Read 1503 times)

neoinbiz

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 22
    • View Profile
Date calculation
« on: October 24, 2019, 08:27:29 pm »
I have a date field "Scheduled Completion Date" and I need to add a new column in the grid to display the number of days until "Scheduled Completion Date" from todays date

Here is code for "Scheduled Completion Date". What would I place under this as new column "Days Until Due"?

Code: [Select]
{ title: "Scheduled Completion Date", align:"center", dataIndx: "Step2aComplete",
     render: function(ui) {
      if(ui.rowData.Step2aComplete){
var usaDate = new Date(ui.rowData.Step2aComplete);
return usaDate.getMonth()+1 + "/" + usaDate.getDate() + "/" + usaDate.getFullYear();     
      }
}
}