AnsweredAssumed Answered

Add due date (15 days from schedule date)

Question asked by nintex2020 on May 24, 2017
Latest reply on May 24, 2017 by emha

I have the following javascript and it only adds day and does not change month. Anything wrong with the code?

For example, this example I am using the current date.

The due date is showing 5/8/2017 instead of 6/8/2017 

 

May 25 2017 - Updated the following code by adding +1 with getMonth(). The code is now working.

 

var date = new Date();
date.setDate(date.getDate() + 15);
var control = NWF$("#"+ jsDueDate);
if(control.val() == "")
{
control.val(date.getMonth()+1 + "/" + date.getDate() + "/" + date.getFullYear());
}

Outcomes