What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    Is it possible to Calculate the Difference between Scheduled Timeframes?

    Asked by cineunit on February 09, 2016 at 10:40 AM

    Hi,

    I'm half way through building my form for our crew to fill out after our film and tvc projects and would need one thing though. I saw you guys have date difference widget. Any chance you have also time difference widget? I would need to calculate our crew shifts and deduct from the shift lunch breaks which are longer then 30min.

    Can you help me with that?

    Thanks!

    time difference time calculations
  • Profile Image
    JotForm Support

    Answered by KadeJM on February 09, 2016 at 12:26 PM

    From what I gather you are looking for a way to calculate a difference in time.

    I found you have this form here http://www.jotformeu.com/form/60382855879371 on your account if that is the one you are trying to attempt this on?

    Can you provide us with an example scenario that you would need to figure out the time difference for for your shifts and lunch breaks? Just looking at your form currently I'm not entirely sure how you are imagining this from your point of view.

    Do you mean if say an employee works from start time 8am til 5pm and takes a 30 minute lunch break you then want to have a way to use a time calculation to configure and display it? Or?

    As far as I know we have form calculations which are time-capable along side some time widgets but I don't know of any that are exactly like or similar to the date difference widget.

  • Profile Image

    Answered by cineunit on February 10, 2016 at 10:12 AM

    that is the form but i'm still in middle of making it. 

    you are correct in terms of what i need. i would like that there is a script that would do following: work duration - breakfast / lunch / dinner time = display total working hours.

  • Profile Image
    JotForm Support

    Answered by KadeJM on February 10, 2016 at 11:24 AM

    No problem and thank you for confirming it.

    Please allow us a bit of time to see if we can help come up with some sort of feasible solution to your request and if possible either myself or one of my colleagues will notify you here in an updated response to this as soon as we can.

     

  • Profile Image
    JotForm Support

    Answered by KadeJM on February 10, 2016 at 11:28 AM

    Also, it would be helpful to know what the expected and projected timeframes are that you are trying to build this around within your form so that we aren't guessing at that part. The original mention i had about 8-5 was just an educated guess though it varies from company to company depending on set or unset schedules if any as far as I know.

    You already stated 30 minutes for a lunch break but what about the other times and what is the typical timeshift amount normally? Does it include overtime?

     

  • Profile Image
    JotForm Support

    Answered by KadeJM on February 10, 2016 at 11:53 AM

    I've found one possible solution from this other thread in attempt to save some time to speed this up and get you going a bit quicker with something one of our team members already came up which may be of some interest to you.

    Please take a look at this modified demo https://form.jotform.com/60404314441947 which you may clone into your own account to take a look at it in the form builder if needed.

    Basically, it's using a form calculation widget (days field) as I suggested originally which uses 2 TimeDate Fields to get the difference between to generate Days and Hours (textbox field).

    You could use this as a starting point to build from and additionally have it calculate breaks as well.

  • Profile Image

    Answered by cineunit on February 10, 2016 at 12:08 PM

    I will explore the option you gave me. It does look what I need, just need to tweak it a bit.

    Ideally I would like to achieve that if the project is say 4 days days long, form would automatically show fields Date (prefilled for each day), Drive out, Breakfast in, breakfast out, crew call, lunch in, lunch out, wrap, dinner in, dinner out, return in warehouse (time). It should also understand whether project starts in evening and ends in next morning but i guess AM/PM selection does that for me.

  • Profile Image
    JotForm Support

    Answered by Mike on February 10, 2016 at 01:43 PM

    To show additional fields you can use conditional logic on form.

    Smart Forms Using Conditional Logic

    There is no way to inject scripts to the form, so you will need to use available tools for time calculations. Here are links to our guides on the calculation subject.

    How to perform calculation in the form

    How to Assign Calculation Value

    If you have any follow up questions, please let us know.

  • Profile Image

    Answered by cineunit on February 14, 2016 at 04:41 AM

    Any chance you still could help me with my form? 

    I have to issues. One is how to calculate the time accurately given the fields i need my crew to fill in and what to do if the day wraps on following day (going over midnight which resets the clock and thus mathematical value to 00:00). 

    If you check my form, i think you will get good glimpse on what i need to achieve.

  • Profile Image
    JotForm Support

    Answered by Kevin_G on February 14, 2016 at 11:10 AM

    Sure, provide us the link to your form, we will take a look on it and will try to find way to achieve what you want.

    Also, you may consider using conditions, as suggested by me colleague above, as well as using the form calculation widget.

    We will wait for your response.

  • Profile Image

    Answered by cineunit on February 14, 2016 at 11:14 AM

    Hi,

    Here is the form. I'm using conditions and it is working the way I need but problem starts when I need to wrap it over past midnight.

    https://form.jotformeu.com/60382855879371

     

  • Profile Image
    JotForm Support

    Answered by Kevin_G on February 14, 2016 at 12:36 PM

    You may use the Time field, you will find it under the Quick Tools in the Form Builder.

    You can capture the current time and then use it in conditions.

    Hope this helps.