13

I'm using the datePicker in the jQuery UI core. I need a date picker that can only pick dates through the past all the way to today.

Is there an easy way to do this? -- Note I'm using the UI core, not the DatePicker Plugin.

My jQuery call:

$(function() {
    $(".datepicker").datepicker();
});

1 Answer 1

34

You should use the maxDate option when initializing the datepicker:

$( ".datepicker" ).datepicker({ maxDate: '0' });

look here for reference: http://jqueryui.com/demos/datepicker/#option-maxDate

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.