jQuery DatePicker with today as maxDate

Emmanuel N picture Emmanuel N · Oct 28, 2011 · Viewed 130.3k times · Source

I would like to set today's date as a maxdate for jQuery datepicker in order to prevent users from picking date greater than today's date

Answer

Alex Peattie picture Alex Peattie · Oct 28, 2011
$(".datepicker").datepicker({maxDate: '0'});

This will set the maxDate to +0 days from the current date (i.e. today). See:

http://api.jqueryui.com/datepicker/#option-maxDate