jQuery datePicker enable select past dates

How to enable the past dates of jQuery inline datePicker?

You need to make sure that the minDate option is null.

example:

$( "#from" ).datepicker( "option", "minDate", null );

Full example:

$( "#from" ).datepicker({
    defaultDate: "-6m",
    buttonImageOnly: true,
    dateFormat: "d MM y",
    changeMonth: true,
    changeYear: true,
    numberOfMonths: 3,
    onSelect: function( selectedDate ) {
        $( "#from" ).datepicker( "option", "minDate", null );
    }
});

By Keenlio, January 14, 2014

What do you think?

Leave a Reply

Your email address will not be published. Required fields are marked *


9 − three =

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>