Get End Time / Using Start Time and Hours Worked
Hello World,
I'm still a Newbie to Acrobat and JavaScript.
I've been combing through the forums, Pubs and Manuals to create this code and cannot seem to get it to give me my answer.
I mean it doesn't display the result in my "StopTime" Text-field (Time - h:MM tt) and because I cannot figure out how to view my results line by line.
I don't know if it's because of prior code.
Could someone please advise what I'm doing wrong.
Here is the code I've created;
// get the start time and added time
var sStart = this.getField('StartTime').value;
var sWork = this.getField('Work').value;
var sTravel = this.getField('Travel').value;
//Convert Time to seconds
var vStart = Time2Num(sStart.FormattedValue, "h:MM tt");
var vWork = (sWork * 3600000);
var vTravel = (sTravel * 3600000);
If(HasValue('StartTime'))
{
If(HasValue('Work') & HasValue('Travel'))
{
// Add Time
var vTotal = vStart + vWork + vTravel;
}
ElseIf(HasValue('Work'))
{
// Add Time
var vTotal = vStart + vWork;
}
Else
{
// Add Time
var vTotal = vStart + vTravel;
}
}
// Convert to time
var vStop = Num2Time(vTotal, "HH:MM");
// Display Time
event.value = ''
'StopTime'.value = util.printd("h:MM tt", vStop);
Any help would be greatly appreciated.
