I want to disable 2 days after today with jquery datepicker, for example today is 12/29/2016 I want the enable date from 1/1/2017. I look the someone code in jsfiddle but I don't know what should I edit https://jsfiddle.net/AcbUf/574/
Html
<input type="text" id="from" />
<input type="text" id="to" />
Js
$(document).ready(function () {
var d = new Date();
var monthNames = ["January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"];
today = monthNames[d.getMonth()] + ' ' + d.getDate() + ' ' + d.getFullYear();
$('#to').attr('disabled', 'disabled');
$('#from').datepicker({
defaultDate: "+3d",
minDate: 1,
maxDate: "+3M",
dateFormat: 'dd M yy',
showOtherMonths: true,
changeMonth: true,
selectOtherMonths: true,
required: true,
showOn: "focus",
numberOfMonths: 1,
});
$('#from').change(function () {
var from = $('#from').datepicker('getDate');
var date_diff = Math.ceil((from.getTime() - Date.parse(today)) / 86400000);
var maxDate_d = date_diff+7+'d';
date_diff = date_diff + 'd';
$('#to').val('').removeAttr('disabled').removeClass('hasDatepicker').datepicker({
dateFormat: 'dd.mm.yy',
minDate: date_diff,
maxDate: maxDate_d
});
});
$('#to').keyup(function () {
$(this).val('');
alert('Please select date from Calendar');
});
$('#from').keyup(function () {
$('#from,#to').val('');
$('#to').attr('disabled', 'disabled');
alert('Please select date from Calendar');
});
});