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

    I'm trying to calculate duration from an arrival date and a departure date

    Asked by hilltopkennels on February 07, 2014 at 05:54 PM

    When I enter the calculation

    {departure}-{arrival} it only evaluates using the day of the month and so gives incorrect results for dates straddling different months

    duration date difference arrival departure two dates 2 dates between 2 dates between two dates calculate difference
  • Profile Image
    JotForm Support

    Answered by abajan on February 07, 2014 at 06:24 PM

    Our calculation wizard has not yet reached that level of sophistication. As such, in order to accomplish the required functionality you would need to embed the form's full source into a web page and add a script to that page to calculate the duration. I'll work on a script and get back to you.


    Cheers

  • Profile Image
    JotForm Support

    Answered by abajan on February 07, 2014 at 07:20 PM

    Upon searching the forum, I was able to find a solution provided by a colleague (EltonCris) here. Please test this demo and let us know if it has the sort of functionality you seek.


    Thanks

  • Profile Image

    Answered by hilltopkennels on February 08, 2014 at 02:10 AM
    Yes that is exactly what I need






    The success of our business depends on recommendations from our customers, so if you’re happy with our service, we would really appreciate it if you would take the time to leave us a review on one or more of these sites; Google, Yell, 192.com, MisterWhat, Yelp

    If for any reason you are less than delighted with our service, please let US know so we may improve.

    ...
  • Profile Image

    Answered by hilltopkennels on February 09, 2014 at 06:58 PM

    I now need a slightly different date calculation

    We levy a daily winter heating charge for bookings with days booked after 1st Oct and before 30th April

     

    I need therefore to calculate how many days of a multi day booking sits within these date ranges.

     

    So arrival date could be 28th April, departure date 5th May

    I need to be able to calculate that 3 days of the booking are before 30th April and therefore apply 3 days of the winter heating charge to the total price.

     

    Any tips? 

  • Profile Image

    Answered by hilltopkennels on February 09, 2014 at 07:01 PM

    Also if I embed a custom script like the one you have already provided, how do I reference that result within the rest of my jotform form?

    i.e. duration in days (calculated using a custom script) would need to be multiplied by the daily rate to return the total price.

  • Profile Image
    JotForm Support

    Answered by ashwin_d on February 09, 2014 at 11:11 PM

    Hello Hilltopkennels,

    By adding custom JavaScript code to your form, it is possible to achieve what you want.

    Your question has reached my colleague as well. One of us will get back to you once we are ready with the custom script. Delivering this to you may take some time as we can only work on source code workarounds in our free time. We will not be able to give you an ETA on this.

    Thank you!

  • Profile Image

    Answered by hilltopkennels on February 10, 2014 at 02:10 AM

    Hey this is what I call support! Very VERY glad for all your help on this. Let me know if you need more info.

     

    Thank you.

    Simon

  • Profile Image
    JotForm Support

    Answered by Welvin on February 10, 2014 at 05:25 AM

    Hi Simon,

    It's our pleasure to help. We'll update you here for our progress.

    Thanks