Adding months to a date
How do create a form field that will add 6 months to a date from another field? The idea is to output an expiration date 6 months after a training date that is entered by the user.
How do create a form field that will add 6 months to a date from another field? The idea is to output an expiration date 6 months after a training date that is entered by the user.
OK, in that case you will need to decide what method to use and then write a script that takes the string value from the first field, converts it to a Date object (using the scand method of the util object), adds the desired amount of time to it and then prints out the result (using the printd method) to the target field. This tool by Joel Geraci could be a great help in doing that: http://practicalpdf.com/the-practicalpdf-date-library-for-adobe-acrobat/
If you're interested, I've developed a tool that allows you to set up exactly this kind of calculation easily and without having to write any code. You can find it here: Custom-made Adobe Scripts: Acrobat -- Apply Automatic Date Calculation
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.