I did a search on the forum for calculating start time and end time and found the following code which I'm utilizing as a formcalc on the duration field.
==============================================================
form1.Page1.Duration::calculate - (FormCalc, client)
if (HasValue(StartTime) and HasValue(EndTime)) then
var in_ = Time2Num(StartTime.formattedValue, "h:MM A")
var out_ = Time2Num(EndTime.formattedValue, "h:MM A")
if (in_ >= out_) then
xfa.host.messageBox("The start time cannot be greater than or equal to the end time.")
$.rawValue = null
else
var diff = out_ - in_
$.rawValue = diff/3600000
endif
else
$.rawValue = null
endif
=============================================================
So when I enter a start time for example of 3:30 pm and end time of 4:00
The duration field will say 0.5
How can I get my form to say 30 minutes instead of placing a decimal number?
Secondly, how can I utilize LC patterns field where the employee can just type 330 or 3:30 and it automatically based on the computer's clock put in on the start time 3:30 PM?
Any help will be greatly appreciated. Thank you.
Attached is the form for viewing:
https://acrobat.com/#d=f1kxh5qjuow5ujyZduF8OQ