I've set my date/time picker to always show 2 days in the future, but I dont want it to show dates if it falls on a sunday or monday.

  • bakingfresh
    Asked on June 23, 2015 at 8:50 AM

    Hello

     

    I have a date/picker on my form, that is there so my customers know which date there product is going to get delivered. (Which is always 2 days after they have placed an order.)

    I have added a date/time picker that always pres-ets the date 2 days in the future from the current date. So for example today is the Tuesday 23rd, and whenever a customer views my form the date/time picker will be pre-set to Thursday 25th. (This is there to tell them their product will be delivered on Thursday 25th).

     

    However I do not deliver on Sundays or Mondays, so if a customer places an order on Friday 26th, the form will say their product will be delivered on Sunday 28th, but I cant deliver on Sundays. In situations like this how to I set it up so if the delivery date falls on a Sunday or Monday, the date picker will automatically change it too the following Tuesday.

     

    Kind Regards

    Stephen

  • Boris
    Replied on June 23, 2015 at 11:09 AM

    Hello Stephen. I have managed to implement this, although it is slightly complex to set up.

    I have created 2 Form Calculations, which calculate if our current date is Friday or Saturday.

    Ive set my date/time picker to always show 2 days in the future, but I dont want it to show dates if it falls on a sunday or monday Screenshot 70

    Friday Calculation was set up like this:

    ( currenttime minus date (2015,06,05 which is a Friday) ) divided by 7.

    Ive set my date/time picker to always show 2 days in the future, but I dont want it to show dates if it falls on a sunday or monday Screenshot 81

    Saturday Calculation is set up the same way, but we've used 2015,06,06 as a date of a known Saturday.

    Ive set my date/time picker to always show 2 days in the future, but I dont want it to show dates if it falls on a sunday or monday Screenshot 92

    After setting up these Calculations ,we are now getting an integer / a whole number if a date matches the same day of the week. So if we use a known Friday, the Friday field will be a whole number.

    Knowing this, we can simply utilize it in our Conditions, which can be set up:

    If currentDate is filled, AND if Friday Calculation is a whole number, AND if Saturday Calculation is NOT a whole number, then we have a Friday and we should add 4 to the current date:

    (Does Not Contain a dot/period means that it is a whole number. AND is set by choosing If ALL of these rules are matched.)

    Ive set my date/time picker to always show 2 days in the future, but I dont want it to show dates if it falls on a sunday or monday Screenshot 103

    Similarly, for a Saturday:

    Ive set my date/time picker to always show 2 days in the future, but I dont want it to show dates if it falls on a sunday or monday Screenshot 114

    We also need to modify your previous rule you've had for adding 2 days into the delivery date field, to prevent conflicts with Friday and Saturday. We do this by setting it up to the following:

    Ive set my date/time picker to always show 2 days in the future, but I dont want it to show dates if it falls on a sunday or monday Screenshot 125

    You can see a demo of these calculations, where I have deliberately left all of these fields visible on the form - so that you can see how it is working in real time. I have also made the current date field visible, so that you can play with changing the current date and seeing what the delivery date will be on particular dates.

    http://form.jotformpro.com/form/51733781281962

    You can clone it to take a closer look. Please let us know Stephen if you hit any snag along the way, we will be happy to help.

  • bakingfresh
    Replied on June 25, 2015 at 5:56 AM

    Hi Thanks for that.

    I have since found out I can not deliver on Saturdays aswell. I want to do the same for Thursdays days as well please. So if someone places an order on Thursday, it will automatically tell the customer there product will be delivered the following Tuesday.

     

    I have looked at what you have set up and I can not get my head round it, I have had a go at trying to set this up myself, would you be able to set this up for me please?

     

    So ATM the delivery date is set 3 days in the future from when the customer orders, if the delivery date falls on a Saturday, Sunday or Monday, I want the delivery date to automatically change to the follow Tuesday.

     

    Many Thanks

    Stephen

  • bakingfresh
    Replied on June 25, 2015 at 8:39 AM

    Hello,

     

    I think I may of have set it up now.

    Could you please check for that is it set up correctly?

    Just to confirm what I am looking for, when someone orders my product, I want to tell them that their product will be delivered 3 days after the date of ordering. So for example, if a customer place an order on Monday, the form will tell them their product will be delivered on Thursday. And if a customer orders a product on Tuesday, it will tell the customer their product will be delivered on Friday. However I can not deliver on a Saturday, Sunday and Monday. So if a customer orders a product on Wednesday, Thursday or Friday, I want the form set up so it will automatically tell the customer their product will be delivered the FOLLOWING Tuesday.

     

    Could you check I have set this up correctly?

     

    Many Thanks

    Stephen

  • KadeJM
    Replied on June 25, 2015 at 12:10 PM

    It looks to me like you may be trying to accomplish this on your form here http://www.jotformeu.com/form/51734948063360 as of now?

    From what I can see it seems you are trying to get your date to push to the following Tuesday if the delivery date happens to be on W, TH, F. However, I don't think it is quite yet there as the current day today is Thursday and the date is showing only 6/28/15 which is 3 days later only still.

    We will need some more time to check on this better and get back to you with a possible solution if possible.

    Ive set my date/time picker to always show 2 days in the future, but I dont want it to show dates if it falls on a sunday or monday Screenshot 20