Copy link to clipboard
Copied
Hi Community,
I've very new to Adobe Pro 2017 and Javascript. I need help creating a pdf form that auto calculates multiple dates in the future.
Here's what I'm trying to do.
> I want to enter using the "Add Date Field" the present date.
> Once the present date is added, I want the form to auto calculate a date 10 days in the future in another field.
> Using a text field or another date field (which ever is easier)
Also, I need to do this multiple times using the original date field as the reference date.
Meaning, I need a date 15 days, 20 days 35 days etc, in the future (all separate entries from the reference present date).
I'm very new, so any help is appreciated, and how I'd add the proposed javascript into the future date field.
Thank you!!
Copy link to clipboard
Copied
Date calculations in JavaScript are tricky. See these tutorials and hand library to learn how to do them:
https://acrobatusers.com/tutorials/working-with-date-and-time-in-acrobat-javascript
https://acrobatusers.com/tutorials/working-with-date-and-time-in-acrobat-javascript-part-2
https://acrobatusers.com/tutorials/working-with-date-and-time-in-acrobat-javascript-part-3
http://practicalpdf.com/the-practicalpdf-date-library-for-adobe-acrobat/
If you're interested, I've developed a tool that allows you to do it very easily, without having to write any code.
You can find it here: Custom-made Adobe Scripts: Acrobat -- Apply Automatic Date Calculation
Copy link to clipboard
Copied
Date calculations in JavaScript are tricky. See these tutorials and hand library to learn how to do them:
https://acrobatusers.com/tutorials/working-with-date-and-time-in-acrobat-javascript
https://acrobatusers.com/tutorials/working-with-date-and-time-in-acrobat-javascript-part-2
https://acrobatusers.com/tutorials/working-with-date-and-time-in-acrobat-javascript-part-3
http://practicalpdf.com/the-practicalpdf-date-library-for-adobe-acrobat/
If you're interested, I've developed a tool that allows you to do it very easily, without having to write any code.
You can find it here: Custom-made Adobe Scripts: Acrobat -- Apply Automatic Date Calculation
Copy link to clipboard
Copied
The documentation for the Acrobat SDK has this Date Arithmetic article with examples.
One can use the JavaScript "setDate()" method to add dates.
The practicablePDF has this library of various date methods you can use.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now