I want to set the maxDate
of jQuery UI to 18/02/2013
but upon trying, it only lets me update it to today's date.
How can I go about doing this?
$("#datepicker'.$row['id'].'").datepicker({
minDate: -0,
dateFormat: \'dd/mm/yy\',
maxDate: 18/02/2013
});
inside the jQuery script code just paste the code. $( ". selector" ). datepicker({ dateFormat: 'yy-mm-dd' });
Syntax: $(". selector"). datepicker( {defaultDate:"+6"} );
datepicker({ beforeShowDay: function( date ) { var highlight = eventDates[date]; if( highlight ) { return [true, "event", 'Tooltip text']; } else { return [true, '', '']; } } }); The complete JavaScript code to highlight specific dates.
If you like to restrict access of users to select a date within a range then there is minDate and maxDate options are available in jQuery UI. Using this you can set the date range of the Datepicker. After defining these options the other days will be disabled which are not in a defined range.
Try this:
$("#datepicker").datepicker({ minDate: -0, maxDate: new Date(2013, 1, 18) });
If you want use hard coded date, use the new Date(2013, 1, 18)
pattern.
If you want to use generic pattern, use "+1D +1M +1Y"
.
Reference link: http://jsfiddle.net/pradkumar_n/wQe8c/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With