How can I add number of days into a date

  • Profile Image
    AzharAbbas
    Asked on March 10, 2016 at 12:06 PM

    How can i Add number of days into a date and i want to get next date excluding weekend days (Skip Saturday & Sunday)

     

    For example: in below form i want like this:

    Original Date + No. of Days = Next Date (Excluding/Skip all weekend days)

     

    https://form.jotform.me/60694851006456

  • Profile Image
    Charlie
    Answered on March 10, 2016 at 02:06 PM

    Unfortunately, it won't work on a Date Picker widget. Date calculations are possible if you'll use the default "DateTime" field found under the "Quick Tools" section.

    However, I am not sure what you would like to do with next date that falls in a weekend? Do you want the date to move the next weekday? Or The day before the weekend starts? Please clarify.

    Here's a sample form that changes the date by adding days on it: https://form.jotform.com/60695497469981. Here's how to set it up:

    1. Add a "DateTime" field for the "Original Date". Use a text box for the "No. of Days". And use a Form Calculation widget where the calculated date will happen. To learn more about form calculation, you can check this guide: http://www.jotform.com/help/259-How-to-perform-calculation-in-the-form 

    2. In the Form Calculation widget, click the "Add Field" button to insert fields here. Then click the "..." to open the math functions.

     

    3. We need to use the function dateString, that converts our date to a text string but allowing us to add a number of days on it. You can use this guide for the math functions: http://www.jotform.com/help/267-Form-Calculation-Math-Function-Reference 

     

    For the next date excluding weekend, that should be possible using conditional logic, but we need to know what you would like to do, skip in a sense of moving on the next weekday or remain on the earlier one like Friday?

    We'll wait for your response.