Calculate estimated shipping date from current date

  • torreszach
    Asked on December 2, 2016 at 4:39 PM

    Hello,

    All I want to do is take the current date, add a number of days to it (for example 3 days), and display the projected shipping date (3 days added to the current shipping date).



    So for example:

    customer chooses a 3 day shipping option on my product.

    Today is 12/2/2016.

    When he clicks on my 3 day shipping radio button, a projected date of 12/5/2016 is calculated and displayed. 

     

    I've tried using the calculation field widget with date(), datestring(), and even just adding and subtracting days; and it gives me crazy dates not even close to the current.

     

    Please help, I'm super frustrated.

    Thanks,

    Zach

     

  • David JotForm Support
    Replied on December 2, 2016 at 6:43 PM

    The way you are thinking of doing it is correct.  However, you would use a condition to update the second field instead of a form calculation widget.

    Create an "Update/Calculate form field" condition:

    Calculate estimated shipping date from current date Image 1 Screenshot 30

    Then, set up your conditions as follows:

    Calculate estimated shipping date from current date Image 2 Screenshot 41

    I have nearly the same setup you have in your form in my example.  A date field for the current date with the default set to the current date.  Then, a second field for the output.  I added a radio button field to my example form for the different shipment time selections.  The summary field is your second date field.  "Today" was added via the "Add field" button on the right.  To get the date + 3 days is simply the today field + 3.

    Here is my example form to show you how it works:

    https://form.jotform.com/63367427084966

    You can clone it to your own account if you would like:

    https://www.jotform.com/help/42-How-to-Clone-an-Existing-Form-from-a-URL

     

  • Zach
    Replied on December 2, 2016 at 7:19 PM

    Okay that works but whenever I put that you can't select a certain day, Sunday for example, it leaves the estimated date field empty. 

  • Mike_G JotForm Support
    Replied on December 2, 2016 at 10:51 PM

    To my understanding, you would like to exempt a day for the shipment, is that correct? For example, let's say you don't want to include Sunday to ship your products and the form was submitted Saturday and 3 days is selected for the shipping time, rather than having Tuesday for the estimated shipping date, it should be Wednesday because Sunday is not being counted.

    Can you help us understand your concern by giving us more details, please?

    We will wait for your response. Thank you.