0

How can I edit DatePicker to start select dates after 3 days of actual date.

I tried :

 $('#thedate').datepicker("setDate", "+3");

But I want to make disable today and the two days after today.

This is a fiddle of my Datepicker.

Fiddle

Sunny
  • 3,185
  • 8
  • 34
  • 66
Liza
  • 197
  • 1
  • 15
  • Do you mean you want to disable from today to next three days? – Sarjan Desai Oct 14 '15 at 10:19
  • Yes, sorry. question edited – Liza Oct 14 '15 at 10:20
  • Hope these links help you, use disable specific date in datepicker: http://stackoverflow.com/questions/15400775/jquery-ui-datepicker-disable-array-of-dates or http://www.spiceforms.com/blog/how-to-disable-dates-in-jquery-datepicker-a-short-guide/ – Neo Oct 14 '15 at 10:25
  • 1
    I assume that you use jquery ui datepicker. Use "beforeShowDay" function you can pass the array of dates to it.. and you can disable the next three days by passing that dates to function. – murli2308 Oct 14 '15 at 10:25

1 Answers1

2

Try minDate option like this:

$('#thedate').datepicker({
    minDate: "+3",
    dateFormat: 'dd-mm-yy'
});
$('#thedate').datepicker("setDate", "+3");

See updated Fiddle

sb9
  • 1,082
  • 7
  • 18