Copy link to clipboard
Copied
OK, I see now that you did do it, but incorrectly. Use this:
var s = this.getField("DatePerformed").valueAsString;
if (s=="") event.value = "";
else {
var d = util.scand("mm/dd/yyyy", s);
d.setMonth(d.getMonth() + 3);
event.value = util.printd("mm/dd/yyyy", d);
}
Copy link to clipboard
Copied
You need to add another condition that checks if the value of the first field is empty, as that would be converted to the current date if you use scand on it.
If you post your code as text it would be easier to help you out with this...
Copy link to clipboard
Copied
Ooops...Sorry about that... Here it is
var d = util.scand("mm/dd/yyyy",this.getField("DatePerformed").valueAsString);
if (this.getField("DatePerformed").valueAsString="") event.value = "";
else d.setMonth(d.getMonth() + 3);
event.value = util.printd("mm/dd/yyyy", d);
Copy link to clipboard
Copied
OK, I see now that you did do it, but incorrectly. Use this:
var s = this.getField("DatePerformed").valueAsString;
if (s=="") event.value = "";
else {
var d = util.scand("mm/dd/yyyy", s);
d.setMonth(d.getMonth() + 3);
event.value = util.printd("mm/dd/yyyy", d);
}
Copy link to clipboard
Copied
Awesome! Works like a champ. Thank you so much!