Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Aspi on Jul 16, 2008 10:05
open dhtmlx forum
Today + 1 day

Dear DhtmlX support Team!

I would like make a onclick like: "var currentTime = new Date()
var month = currentTime.getMonth() + 1";

The code is

...
function jotallasutolso(date) {
        document.getElementById('jotallasutolso').value = cal_jotallasutolso.getFormatedDate(null,date);
        document.getElementById('cal_jotallasutolso').style.display = 'none';
        dateFrom = new Date(date);

var month = dateForm.getDate() + 1;
document.getElementById('biztkezdete').value = month;
        return true;}

thanks your answer!
Answer posted by Support on Jul 17, 2008 05:41
The date objext allows month manipulation, so you can get it as
    var date = new Date();
    var nextdate = date.setMonth(date.getMonth+1); // getDate  and setDate if you need a next day

If you need to get next month as its text representation, it can be done as
    var nexttext =  cal_jotallasutolso.getFormatedDate("%M",nextdate)
Answer posted by aspi on Jul 17, 2008 12:19

I don't understand clealyr :)

here is my code:

function waranty_last(date) {
  document.getElementById('warantylast').value = cal_warantylast.getFormatedDate(null,date);
  document.getElementById('cal_warantylast').style.display = 'none';
  dateFrom = new Date(date);
  var nextdate = date.setDate(date.getDate+1);
  document.getElementById('insurance_firstdate').value = cal_jotallasutolso.getFormatedDate(null,nextdate);
  return true;}

i would like this output if warantylast=2008.07.13

                                   insurance_firstdate = 2008.07.14

 

thanks

 

Answer posted by Support on Jul 18, 2008 03:38
Pleas check attached sample
Attachments (1)