add days to a date
I am trying to add 10 days to a date which a user enters into a form. I have created a date field "Date1", I have created a Date field "Date2". In the Calculate tab , under Custom Script, i placed the following code
var s1 = this.getField("Date1").valueAsString;
if (s1=="") event.value = "";
else {
var d1 = util.scand("dd/mm/yyyy", s1);
d1.setDate(d1.getDate()+30);
event.value = util.printd("dd/mm/yyyy", d1);
}
It does not work (I took this code from a previous post)
I have tried simple calculated fields like adding two numbers together, and i can get that to work
