Add two days to date and exclude weekends

  • Profile Image
    DiscoveryCharterSchools
    Asked on July 13, 2019 at 03:24 PM

    I have an order form where I ask the user when they want to pick up their order.  I would like the default for this field to be two days after the current date and exclude weekends from this calculation.  So if the order is placed on Friday then the earliest pickup date would be Tuesday.

    I have read several posts from others with a similar question and have tried several different things but can't seem to get it to work.  The best answer I saw was to go to the date limits and set the start date to date+2.  Maybe that used to work in July 2018 but I can't seem to get that to work (or maybe I am doing things wrong).  Here is the link to that post...https://www.jotform.com/answers/1528624-How-to-add-days-into-date-picker-from-today-s-date

    Please let me know how to do this.

  • Profile Image
    Mike_G
    Answered on July 13, 2019 at 07:17 PM

    If I'm understanding your concern correctly, you would like the available date for pick-up to start counting from the first possible date. So if today is a Friday. And if Saturdays and Sundays are disabled in the calendar picker, then it should start counting from Monday. Therefore, 2 days from today should be Tuesday.


    I would like to apologize for any inconvenience. However, if you set the limit of the Date field in your form like this (please see screenshot below), the date would still start counting from the next day regardless if that date is disabled.

    1563058389zt18_37_14.png

    If Saturdays and Sundays are not disabled, today+2 on a Friday would be Sunday.

    1563058484zt18_25_49.png

    In your form's case, Monday would be the next available date, not Sunday, because it is disabled.

    1563058937zt18_31_00.png

    As for a solution, perhaps you can create multiple "When do you want to pick order up?" date fields in your form which each one will show based on the current day of the week. You will need another Date field set to current and conditions for this workaround. For, example, if today is a Friday or a Thursday then the "When do you want to pick order up?" date field that will show is the one that has a "today+4" in its Start Date limit. Other days of the week can have the original "today+2" "When do you want to pick order up?" date field.

    Let us know if that could work for you and if you need assistance in setting it up.