jQuery datepicker to prevent past date

Solution 1:

Try this:

$("#datepicker").datepicker({ minDate: 0 });

Remove the quotes from 0.

Solution 2:

You just need to specify a minimum date - setting it to 0 means that the minimum date is 0 days from today i.e. today. You could pass the string '0d' instead (the default unit is days).

$(function () {
    $('#date').datepicker({ minDate: 0 });
});