Hi,
I am subtracting one time from another with the code attached. However I now want to total a number of these subsequent calcualtions. I am getting an error when i try to total all these hours. The code actually refers to a change I need to make to the code (change to 'event value') but I can't seem to get it to work.
can you anyone show me the change I need?
cheers
// Time Values
var cStartTime = this.getField("Dropdown11M").value;
var cEndTime = this.getField("Dropdown12M").value;
// Only process if field contains a value
if((cStartTime != "") && (cEndTime != ""))
{
// Convert to Hours Decimal value
var aStartTime = cStartTime.split(":");
var nStartTime = Number(aStartTime[0]) + Number(aStartTime[1])/60;
var aEndTime = cEndTime.split(":");
var nEndTime = Number(aEndTime[0]) + Number(aEndTime[1])/60;
// Find Difference
var nTimeDiff = nEndTime - nStartTime;
var nHours = Math.floor(nTimeDiff );
var nMinutes = Math.floor((nTimeDiff - nHours)*60 + 0.5);
// If used in a calculation, may need to be changed to "event.value ="
this.getField("TH1M").value = util.printf("%02d:%02d",nHours,nMinutes);
}
else
this.getField("TH1M").value = "";
- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com