Thank you wary match your fast reply
But the code don’t working.
Here is
function waranty_last(date) {
var waranty = document.getElementById(‘waranty_years’).value;
document.getElementById(‘waranty_last’).value = cal_waranty_last.getFormatedDate(null, date);
document.getElementById(‘cal_waranty_last’).style.display = ‘none’;
dateFrom = new Date(date);
var nextdate = dateFrom.setDate(dateFrom.getDate()+1);
var waranty_end = dateFrom.setYear(parseInt(dateFrom.getYear())+waranty);
document.getElementById(‘waranty_start’).value = cal_waranty_last.getFormatedDate(null, nextdate);
document.getElementById(‘waranty_ending’).value = cal_waranty_last.getFormatedDate(null, waranty_end);
return true;}
dates 2008-07-26 nextdate => 2008-07-27 waranty_end => 1081-07-27
what’s wrong? thanks your help
One more update is necessary
Instead of
var waranty_end = dateFrom.setYear(parseInt(dateFrom.getYear())+waranty);
Need to be used
var waranty_end = dateFrom.setYear(parseInt(dateFrom.getFullYear())+waranty);