-1

Possible Duplicate:
Can the jQuery UI Datepicker be made to disable Saturdays and Sundays (and holidays)?

I am using jQuery Datepicker.

What i want to do is select a delivery date of today, or tomorrow -

1) It is supposed to blank out the next 3 working days ie if I order Monday my earliest delivery date to choose is Friday.

2) Disable December 20th to 27th 2011 as options

3) Weekends has to be disable

4) all UK holidays has to be disabled

Can this be done? If so, how?

Community
  • 1
  • 1
user580950
  • 3,558
  • 12
  • 49
  • 94
  • 1
    http://stackoverflow.com/questions/501943/can-the-jquery-ui-datepicker-be-made-to-disable-saturdays-and-sundays-and-holid – Thom Wiggers Nov 21 '11 at 14:13

1 Answers1

0

The minDate option enables you to select a minimum date.

Computing the next business day is more complicated, especially if you want to factor in regional holidays. That will require some kind of server-side code, since it's impossible to determine programmatically if a holiday is coming up.

However, if it's a short-term solution you need (i.e. just between now and the end of the Christmas shopping season), I would simply hard-code an array of valid business days which can be fed into JavaScript's Date object. Loop through that array, find the first date which is greater than today's date, and add two to the index to get "three business days from now".

Blazemonger
  • 90,923
  • 26
  • 142
  • 180