How can I add multiple time durations

  • Middlesex01
    Asked on February 6, 2019 at 1:43 PM

    Hi

    I'm trying to add multiple time duration's together from multiple time field's with ranges.  How can I do this?

    I ultimately want a total number of hours and minutes of multiple time ranges.

    Thanks

  • Alperendurmus
    Replied on February 6, 2019 at 3:09 PM

    As I understand, you want to calculate total number of hours and minutes of multiple time ranges. It looks like simple JotForm's 'Update/Calculate Field' issue. It is true. You can reach this field with Settings > Conditions.

    In 'Update/Calculate Field' you can easily calculate some complex calculations. Firstly, I calculated all time ranges in case one of 'Time' field is filled.

    1549483479Adsız Screenshot 10

    But, it was in decimal system. I converted it in sexagesimal system with floor() function help.

    How can I add multiple time durations Image 21

    How can I add multiple time durations Image 32

    For this I added variable fields named 'floor' and 'totalWith'. They are all hidden fields. Don't care. 

    Finally, I copied result value to 'Total Time' field.

    How can I add multiple time durations Image 43

    It works in my end. You can clone my form to look. 
    https://form.jotform.com/90365895531970

     

  • jonathan
    Replied on February 6, 2019 at 4:45 PM

    The solution suggested by @Alperendurmus should work.

    You can use form calculation to add multiple time duration and have the total duration.

    How to Perform Form Calculation Using a Widget

    Let us know if you need further assistance.


    Related user guide: Mastering Date and Time Calculation