Copy link to clipboard
Copied
Hello,
I have a date field A with the format dd/mm/yy. In a field B, I want to have a calculation of A + 2 years. How should I do it ?
Thank you for your help.
Use this as a validation script of field A:
if(event.value == "")
this.getField("B").value = "";
else{
var year = util.scand("dd/mm/yy", event.value)
year.setFullYear(year.getFullYear() +2);
this.getField("B").value = util.printd("dd/mm/yy", year);}
Copy link to clipboard
Copied
Use this as a validation script of field A:
if(event.value == "")
this.getField("B").value = "";
else{
var year = util.scand("dd/mm/yy", event.value)
year.setFullYear(year.getFullYear() +2);
this.getField("B").value = util.printd("dd/mm/yy", year);}
Copy link to clipboard
Copied
It's perfect, thanks 😉