Skip to main content
이 주제는 답변이 닫혔습니다.
최고의 답변: try67

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);
}

 

 

4 답변

try67
Community Expert
Community Expert
November 2, 2021

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...

Inspiring
November 2, 2021

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);

try67
Community Expert
try67Community Expert답변
Community Expert
November 2, 2021

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);
}