Adding Time in LiveCycle (FormCalc)

Avatar

Avatar

Alijay

Avatar

Alijay

Alijay

21-01-2016

Hello,


Hoping that someone can help me with FormCalc code. I am a novice at LiveCycle and by no means a programmer. I am currently working on a form where several sets of START and END times (24hr clock) are entered - sometimes more than 10 sets.


The form is then supposed to calculate the difference between each set of times then give a total time.


E.g.

START1: 14:00
END1:    14:30
TOTAL1:  0:30


START2:  14:45
END2:      15:35
TOTAL2:    0:50


START3:  15:40

END3:      15:55
TOTAL3:    0:35                    TOTAL TIME: 01:55

START14:0014:4515:40
END14:3015:3515:55
TOTAL0:300:500:35


TOTAL TIME1:55



See the attached sample PDF form. http://1drv.ms/1SzWYPX


So far Ive been able to script the form to calculate the difference between START and END times in hours and minutes (24hr) in Formcalc without getting a negative result even when the END time is the next day by slightly tweaking a suggestion made in another thread on time-sheet calculations https://forums.adobe.com/message/3428679. However, I am unable to add all the times together to give an accurate total time in HH:MM.


I searched extensively for examples of script for adding hours and minutes in Formcalc, but I haven't found anything thus far. I would be extremely grateful if anyone could point me in the right direction.


Is it possible to do this in Livecycle, that is add a set of time by referencing fields that were already scripted to calculate the difference between time?


Any assistance would be greatly appreciated.


Thanks in advance.

Accepted Solutions (0)

Answers (0)