I have been trying to add a day for another date field with date selected of current field
,
onSelect: function(date) {
var date2 = $(\'.currDate\
setDate
and getDate
are the functions supported by Date()
of js while you getDate from datepicker it returns as string so you need to convert it or try this code:
onSelect: function(date) {
if(date!=undefined){
var dateObject=new Date(date);
dateObject.setDate(dateObject.getDate()+1);
$('.nextDt').datepicker('setDate', dateObject);
}
}
Here is Demo Alerting Current and Next Date