Skip to main content
Participating Frequently
September 6, 2024
Answered

Date Formula

  • September 6, 2024
  • 1 reply
  • 567 views

Hi all,

 

Hope someone can help. Is it possible to have a formula that adds only the next month from the field before.

 

I need date2 to show 05-Nov-2024

date3 to show 05-Nov-2024

date4 to show 05-Dec-2024

date5 to show 05-Jan-2025

 

So the year would also need to update when a new one is reached.

 

Is this possible?

 

Cheers

Chris

This topic has been closed for replies.
Correct answer bebarth

Hi,

In validation script of your "Date1" field you write:

var oDate=util.scand("dd-mmmm-yyyy",event.value);
for (var i=2; i<=12; i++) {
	oDate.setMonth(oDate.getMonth()+1);
	this.getField("Date"+i).value=util.printd("dd-mmmm-yyyy",oDate);
}

@+

1 reply

bebarth
Community Expert
bebarthCommunity ExpertCorrect answer
Community Expert
September 6, 2024

Hi,

In validation script of your "Date1" field you write:

var oDate=util.scand("dd-mmmm-yyyy",event.value);
for (var i=2; i<=12; i++) {
	oDate.setMonth(oDate.getMonth()+1);
	this.getField("Date"+i).value=util.printd("dd-mmmm-yyyy",oDate);
}

@+

Cjj1984Author
Participating Frequently
September 6, 2024

Thanks you so much