Form Calculation: Calculating number of nights between two date fields

  • Profile Image
    lyndalalleyn
    Asked on March 30, 2026 at 5:19 AM

    Hi there,


    I've tried many different conditions and different widgets and methods trying to calculate the number of nights between two date fields, with no luck. Can you advise what I'm doing wrong? I've tried multiple widgets, with and without time fields and no change.

  • Profile Image
    Bojan Support Team Lead
    Replied on March 30, 2026 at 5:38 AM

    Hi Lyndal,

    Thanks for reaching out to Jotform Support. I have checked your form, and it looks like you're trying to use both calculation widget and conditions to get the total number of nights. Let's first disable the conditions, since they are not needed:

    1. While in Form Builder, click on Settings at the top orange bar.
    2. Choose Conditions from the left menu.
    3. Click Select All to select all conditions.
    4. New buttons will appear, and click on Disable.

    
Form Calculation: Calculating number of nights between two date fields
Image-1

    Now, let's configure the calculation widget:

    1. Go back to Form Builder, by clicking the Build option from the top orange bar.
    2. Select the calculation widget by clicking on it.
    3. Click the Wand icon next to it.

    
Form Calculation: Calculating number of nights between two date fields
Image-2

    Configure your calculation like this:

    
Form Calculation: Calculating number of nights between two date fields
Image-3

    You should now get a difference between the two dates:

    
Form Calculation: Calculating number of nights between two date fields
Image-4

    Give it a try and let us know how it goes.

  • Profile Image
    lyndalalleyn
    Replied on March 31, 2026 at 8:00 PM

    Thank you so much, this worked! I was doing way too many things for a simple action.

    I've noticed I have 2 forms in my workspace, is this because i converted one to mobile? Is the link teh same if i send to mobile or desktop?
  • Profile Image
    Lorenz JotForm Support
    Replied on March 31, 2026 at 8:07 PM

    Hi Lyndal,

    I’ve gone ahead and moved your other question to a separate thread to keep things tidy, and someone from our Support Team will help you out with it here.

    Let us know if there's anything else we can help you with.