0

This is my code:

$('#dp').datepicker();
$('#dp').datepicker( "setDate", "05/01/2013" );
$('#dp').datepicker("option", "minDate", "07/01/2013" );

Currently when I open the date picker I see the month of July 2013 since this is the minDate, however I would like to see the month of May 2013 and see all the dates for that month disabled (since the minDate is July 2013).

Is it possible to setDate to a month prior to the minDate?

Or Weinberger
  • 7,332
  • 23
  • 71
  • 116
  • If specific dates need to be disabled, review this: http://stackoverflow.com/questions/9742289/jquery-ui-date-picker-disabling-specific-dates and http://stackoverflow.com/questions/15400775/jquery-ui-datepicker-disable-array-of-dates – zedfoxus Jul 19 '13 at 17:32

1 Answers1

1

Try this:

var d = $.datepicker.parseDate("mm/dd/yy", "07/01/2013");
$('#dp').datepicker({
    beforeShowDay: function (date) {
        return [date >= d, ''];
    }
});
$('#dp').datepicker("setDate", "05/01/2013");

jsFiddle example

j08691
  • 204,283
  • 31
  • 260
  • 272