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

    Different results displayed when calculating difference between two dates using Form Calculation widget and Date Difference widget

    Asked by grade4pagasa on February 25, 2016 at 03:47 AM

    The Dates Difference widget calculates the number of day which includes all the dates specified in the widget, right? For example, March 13 - 18 2016 is calculated as 6 days (March 13, 14, 15, 16, 17, 18). 

    But why is it different when I calculated using form calculation with the formula:
    last rental day - first rental day?
    which gives me 5 days only (March 13-14, 14-15, 15-16, 16-17, 17-18)? 

    Here's the link of the form

    This is the link of the related thread

    Thanks. 

    - Randy

     

    date calculation form calculation
  • Profile Image
    JotForm Support

    Answered by Kiran on February 25, 2016 at 11:05 AM

    I see the difference what you mean. It seems the calculation widget is using the normal calculation method with the day field. Let me forward the issue to our backend team to take a look at this. 

    You'll be posted through this thread once we have any update on this. Thank you! 

  • Profile Image

    Answered by grade4pagasa on April 20, 2016 at 10:58 AM

    Please close this ticket as I already researched the answer. 

    Thanks.

  • Profile Image
    JotForm Support

    Answered by Kiran on April 20, 2016 at 12:09 PM

    Glad to see that you have managed to get a workaround to the issue. I see that the difference is still appearing in my test form. I see that the ticket is still open with our backend team and a developer is already assigned to the ticket. 

    Since the ticket is open and once we have the fix to the issue, the update will be posted on this thread. Thank you! 

  • Profile Image

    Answered by grade4pagasa on April 20, 2016 at 12:24 PM

    Hi Kiran. 

    My searches showed me that when calculating duration of days, the calculated days are inclusive of all the days specified. That is, (date 1 - date 2) + 1.

  • Profile Image
    JotForm Support

    Answered by Kiran on April 20, 2016 at 01:50 PM

    Thank you for letting us know what you have worked out to fix the issue. Simple workaround. :)

  • Profile Image
    JotForm Support

    Answered by TitusN on April 25, 2016 at 07:55 AM

    Hello, 

    We've also corrected the dates difference widget to calculate the difference between the midnight of the first date to the midnight of the second date. 

    Thanks for reporting this.