Yet another question.
Thank you wery much the sample file, everything is clear,but a ihave another question.
I create same method for year, but made a strange behaviour.
The code is:
function waranty_last(date) {
var waranty_years = document.getElementById(‘waranty’).value;
document.getElementById(‘warantylast’).value = waranty_last.getFormatedDate(null,date);
document.getElementById(‘cal_waranty_last’).style.display = ‘none’;
dateFrom = new Date(date);
var futrure_year = dateFrom.seYear(dateFrom.getYear()+waranty_years);
document.getElementById(‘waranty_begin’).value = waranty_last.getFormatedDate(null, future_year);
return true;
}
the result is example: 20081-07-14
thanks your answer
The problem is in type casting, just use
var futrure_year = dateFrom.seYear(parseInt(dateFrom.getYear())+waranty_years);