Adding Days to a Date Picker field

  • Profile Image
    Tad_Matthews
    Asked on May 22, 2026 at 7:24 AM

    Hello,

    I have a Date Picker filed, {q2_datetime0}. I would like to ad a second field to the form that would display a date that is 20 days after that referenced Date Picker field, {q2_datetime0 + 30}. I cannot see how to get the addDays() function to work or if this is the proper use of this function. Can you tell me how to achieve this?

    Example:

    Original Date = "2026-05-02"

    Calculated Date = "2026-05-22"


  • Profile Image
    Podo: Support Specialist
    Replied on May 22, 2026 at 7:25 AM

    Hi Tad,

    Thanks for reaching out to Jotform Support. I'm an AI assistant here to assist you.

    You can add 20 days to a Date Picker value by using a Form Calculation widget with the date() and addDays() functions, then pass that result into another Date Picker field. Let me walk you through it:

    Phase 1: Add the fields

    1. Open your form in Form Builder.
    2. Add your main Date Picker field (this is your original date, e.g. {q2_datetime0}).
    3. Add a second Date Picker field that will display the calculated date (20 days later). You can rename it to something like “Calculated Date”.
    4. Add a Form Calculation widget from the Widgets tab; this will do the date math.

    Phase 2: Configure the calculation (add 20 days)

    1. Click on the Form Calculation widget to open its settings.
    2. Click on Add Field and select your original Date Picker field (e.g. {q2_datetime0}).
    3. Wrap that field with the date() function, then apply addDays(20). The formula should look like:
      addDays(date({q2_datetime0}), 20)
    4. Set the widget’s Result type to Date (not Number or Text), so it outputs a proper date.
    5. Click on Save.

    Phase 3: Populate the second Date Picker from the calculation

    1. Go to Settings at the top of Form Builder.
    2. Click on Conditions on the left, then choose Update/Calculate Field.
    3. Set the condition so that when the original Date Picker is filled, the form will copy the calculated date into your second Date Picker. For example:
      IF Original Date Is Filled
      DO Copy a Field’s value
      FROM [Form Calculation widget]
      TO [Calculated Date Date Picker]
    4. Save the condition.

    Now, when the user selects 2026-05-02 in the original Date Picker, the calculation addDays(date({q2_datetime0}), 20) will produce 2026-05-22, and the condition will place that value into your second Date Picker field.

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

Your Reply