Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by aspi on Jul 18, 2008 23:16
open dhtmlx forum
dhtmlXCalendar

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

Answer posted by Support on Jul 21, 2008 02:06
The problem is in type casting, just use
    var futrure_year = dateFrom.seYear(parseInt(dateFrom.getYear())+waranty_years);