$(function () {
$("#txtFrom").datepicker({
numberOfMonths: 2,
onSelect: function (selected) {
var dt = new Date(selected);
dt.setDate(dt.getDate() + 1);
$("#txtTo").datepicker("option", "minDate", dt);
}
});
$("#txtTo").datepicker({
numberOfMonths: 2,
onSelect: function (selected) {
var dt = new Date(selected);
dt.setDate(dt.getDate() - 1);
$("#txtFrom").datepicker("option", "maxDate", dt);
}
});
});
if you are using dd-mm-yy format use this code
sd=txt.split("-");
actdate=sd[1]+"/"+sd[0]+"/"+sd[2];
var dt = new Date(actdate);
dt.setDate(dt.getDate() +5);
var mydate=dt.getDate()+'-'+(dt.getMonth()+1)+'-'+dt.getFullYear();
No comments:
Post a Comment