Skip to main content
Abin Mathew
Participant
January 25, 2019
Question

Calculation Future dates with number of days

  • January 25, 2019
  • 1 reply
  • 782 views
Can someone help with script for Adobe pdf.

I got 3 text field

Start Date

Number of Months

End Date


So I want a script when i populate Start date and Number of months, automatically populate the end date


example


I enter start date= 1/12/2018

then i enter Number of months= 2

the output should be= 2/02/2019

Can someone help me on this?

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
January 25, 2019

It sounds like a simple task, but it's actually not. The tricky part is defining what "a month" means. Is it 30 calendar days? 31? Full calendar months? Why, for example, is the starting date in your example the 1st but the end date the 2nd? And what about if the starting date doesn't exist in the end month... For example, 1 month after January 31st. Is that February 28th (a full calendar month)? February 29th (if it's a leap year)? March 2nd (+30 days, if it's not a leap year)? March 3rd (+31 days, if it's not a leap year)? etc.

Abin Mathew
Participant
January 26, 2019

I am not understanding. It’s should be calculating the full month. Example starting date the properties are set to Mm/did/yyyy and the number of month properties are set to numbers in properties. other than the script is there any calculation for this.

try67
Community Expert
Community Expert
January 26, 2019

This is only possible with a script.

You didn't answer my question: What should be the result if the starting date is January 31st and you add one month to it?