Hello!
I'm building a timesheet form in which I need to calculate the difference between start and end times and present the result.
I'm trying to do this with FormCalc but if it is easier with JS it's ok too.
So this is what I did on the total field, using the calculate event on a NUMERIC field called decimalValue:
elapsed = Time2Num(endTime.formattedValue, "HH:MM") - Time2Num(startTime.formattedValue, "HH:MM")
And then I tried to convert into a time field:
total = decimalValue.rawValue;
$.formattedValue = Num2Time(total, "HH:MM")
Well, it doesn't work, it gives me crazy results in the datetime (total) field. If I type 09:00 and 09:30, the end result is... 22:30. Huh?
Please, could someone help me understand how this thing works?
Thank you very much for any hints!
Marcos