Calculating date Difference into int field
Posted: 27 Nov 2018
I'm trying to calculate the difference in days between to dates after the second has been changed. I've used a formula found in the forums here, but can't seem to get the value in "daystaken" to update. Is the correct format I should be looking at?
fd.field('Returned').change(function(){
var calcStartTime = parseInt(fd.field('RecordedDate').value().replace(/,/g, ''));
var calcEndTime = parseInt(fd.field('ActualReturn').value().replace(/,/g, ''));
var cTotalTime = cEndTime - cStartTime;
fd.field('daystaken').value(cTotalTime);
});
fd.field('Returned').change(function(){
var calcStartTime = parseInt(fd.field('RecordedDate').value().replace(/,/g, ''));
var calcEndTime = parseInt(fd.field('ActualReturn').value().replace(/,/g, ''));
var cTotalTime = cEndTime - cStartTime;
fd.field('daystaken').value(cTotalTime);
});