Questions and discussion about using ProcessMaker: user interface, running cases & functionality
By NAlvarado
#815096
I have 2 dates in the dynaform formatted as DD-MMM-YYYY. How do I find the difference in days between these 2 fields? I googled a few things but nothing seemed to work. Thanks!
User avatar
By amosbatto
#815103
Do it this way:
Code: Select all
function differenceInDays(startDate, endDate) {
  var oEnd = moment(endDate);
  var oStart = moment(startDate);
  var result = '';
  
  if (oStart.isValid() && oEnd.isValid()) { 
    result = moment.duration(oEnd.diff(oStart)).asDays();
  }
  
  $("#differenceInDays").setValue(result);
}  

$("#projectStarts").setOnchange(function(newVal, oldVal) {
  differenceInDays( newVal, $("#projectEnds").getValue() );
})

$("#projectEnds").setOnchange(function(newVal, oldVal) {
  differenceInDays( $("#projectStarts").getValue(), newVal );
})
(4.69 KiB) Downloaded 227 times

DO we have to pay tax for trade https://www.getfir[…]

Mosquito Zapper Reviews

https://www.facebook.com/sammosquitozapper https:[…]

https://www.facebook.com/sammosquitozapper https:[…]

Are you looking for a simple method to import EML […]