Joget DX Available for Download

Check out Joget DX, the next generation successor to Joget Workflow for faster, simpler digital transformation.

Skip to end of metadata
Go to start of metadata


To calculate the duration between 2 given dates



$('input[name="fromDatepicker"], input[name="toDatepicker"]').change( function(){
      d1 = $('input[name="fromDatepicker"]').datepicker('getDate');
      d2 = $('input[name="toDatepicker"]').datepicker('getDate');
      diff = 0;
      if (d1 && d2) {
            diff = Math.floor((d2.getTime() - d1.getTime()) / 86400000); // ms per day

Sample App Download