I've seen examples posted before of IF statements in Javascript before, but I've tried every combination and I can't get a simple IF statement to work.
I have a fillable PDF which deals with time employees work.
There's Start_Time1, Lunch1, End_Time1, and Total_Hours1 fields
I'm converting the time entered to "Military time" in order to subtract hours and a final hour count.
Without an IF statement, this bit of code gives me the correct answer:
((End_Time1 + 12) - Start_Time1) - Lunch1
Example, End_Time1 = 5 - (5pm)
Start_Time1 = 8 - (8am)
Lunch1 = 1 - (1 hour)
The code will give me a total hours of 8 from the 17-8-1.
However, some part-time people come in at 1pm or (13:00) and the above code won't work properly.
Below is the code I need, I've removed all attempts of Javascripting since none work.
if (Start_Time1 > 7) then
((End_Time1 + 12) - Start_Time1) - Lunch1
else
if (Start_Time1 < 7) {((End_Time1 + 12) - (Start_Time1 + 12)) - Lunch1
Any help is appreciated. I'm a VB pro, not so much a Java :)
PS - You should also probably handle the case when Start_Time1 is exactly 7.
- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com