How do I change this code
minDate: ‘2012/3/4’+’5D’,
var dates = $( "#from, #to" ).datepicker({
dateFormat: 'yy/mm/dd',
changeMonth: true,
**minDate: '2012/3/4'+'5D',**
onSelect: function() {
var d1=new Date($('#from').val());
var d2=new Date($('#to').val());
$('#quantity').val((Math.ceil((d2-d1)/86400000)));
}
});
to min date be=>2012/3/9
tanks.
Disclaimer: If it’s actually hardcoded, just change it to
'2012/3/9'.Parse the date, add 5 days, and convert it to a string again:
Here’s a demo.
And here it is put in your code: