0

I am looking to use the datepicker to set up an ordering form on my website.

I have a rule that if a user can order before 3pm (GMT) then they can order the same day, if they try and order after 3pm then they need to choose the next available date.

I can use datepicker to set the minDate to +1 and it always picks a day ahead, but I would prefer to use the 3pm rule.

I have tried a few different ways, but I am not sure how to do this.

Any help much appreciated...

Thanks

Redwall
  • 1,010
  • 5
  • 30
  • 55

1 Answers1

1

You should use the time on the server to deliver the JavaScript to the page with the relevant date set.

Matt
  • 9,068
  • 12
  • 64
  • 84
  • +1. Agreed, otherwise you could change your system clock so that it would let you insert order after 3pm, which isn't terrible if your server checks too, but it's probably not what you want. – Neil May 03 '12 at 11:33
  • Hi Matt, thanks for the answer. Sounds great, but could u help me understand how that is possible in the answer? My jsfiddle example is here..http://jsfiddle.net/NHdEX/14/ – Redwall May 03 '12 at 11:48
  • I've not delved too deep into your `getMinDate()` method but I reckon it could basically be replaced by a server side script that just outputs the correct date. This date could then be put into the page where your javascript can just read it, rather than trying to generate it. – Matt May 03 '12 at 11:56
  • Thanks Matt, I will prob try to get some assistance locally to figure this out as I am not good at javascript at all and would not know where to begin...I guess I was hoping I could just change some variables on the date picker that would of already been built in for this scenario..cheers – Redwall May 03 '12 at 12:11