PDF Editing Issues

How to Add One Day to Dates in Repeating Acrobat PDF Form Rows

Algirdas JasaitisAlgirdas Jasaitis Nov 5, 2026 868 views

Question details

The user needs to automatically calculate and populate dates in repeating PDF form rows so that each subsequent row sequentially increases by one day.

How to Add One Day to Dates in Repeating Acrobat Form Rows
Product
Adobe Acrobat Pro DC / PDF Forms
Device & OS
not provided
Scenario
Creating dynamic PDF forms where sequential rows require consecutive dates based on a parent field's value.
Observed behavior
Adding '1' directly to a date string fails to calculate the next date; proper JavaScript date objects and parsing functions are required to achieve date arithmetic.
Before you start

Ensure you have access to a PDF editor that supports JavaScript custom calculations (like Adobe Acrobat Pro DC) and verify the exact name and format of your parent date field.

Solution 1Recommended

Use Acrobat JavaScript Date Functions

Utilize the built-in Acrobat JavaScript util.scand and util.printd methods to parse the parent date string into a Date object, add one day, and format the output.

Acrobat handles date fields as text strings, meaning you cannot perform basic math directly on the field value. To perform date arithmetic, you must first convert the string to a JavaScript Date object, use the setDate method to increment the day, and then format it back into a string for the target field.

1
Identify Parent Field Information

Note the exact name of your parent date field (e.g., 'myParentField') and the date format being used in that field (e.g., 'mmm d, yyyy').

2
Open Target Field Properties

Right-click the target repeating row field where you want the new incremented date to appear, select 'Properties', and navigate to the 'Calculate' tab.

3
Enter Custom Calculation Script

Choose 'Custom calculation script' and click 'Edit'. Paste the following code: var startDate = util.scand("mmm d, yyyy", this.getField("myParentField").value); startDate.setDate(startDate.getDate() + 1); event.value = util.printd("mmm d, yyyy", startDate);

4
Adjust to Match Form Format

Modify 'myParentField' and both instances of the 'mmm d, yyyy' string to exactly match your form's specific field name and date pattern. Save and close the properties window.

Use Acrobat JavaScript Date Functions
Scripting Syntax Variations: Keep in mind that Adobe LiveCycle (which uses XFA/FormCalc) and Acrobat Pro DC (AcroForms) use entirely different scripting syntax for date calculations. This solution specifically applies to Acrobat Pro DC.
Powerful PDF Form Editor

View and Manage PDF Forms Easily with WPS Office

WPS Office provides a comprehensive, lightweight PDF toolkit that allows you to easily view, fill, and manage interactive PDF forms while enjoying seamless compatibility with standard office file formats.

  1. 1. Open the PDF Form in WPS Office: Launch WPS Office and open your interactive PDF form document.
  2. 2. Access Interactive Elements: Navigate to the designated form fields. WPS PDF will automatically highlight fillable areas.
  3. 3. Fill and Execute Scripts: Click into the fields to enter your data. Standard document-level formatting and simple field calculations will update automatically as you type.
  4. 4. Save and Export: Once the form rows are populated, click 'Save' or export the document to share your updated form.
Free, lightweight, and easy-to-use PDF reading and form-filling toolsFully compatible with standard PDF forms and interactive document elementsSeamlessly export, convert, and edit across Word, Excel, PowerPoint, and PDF files
microsoft office alternative - wps office

Frequently Asked Questions

Why does adding '1' to my PDF date field return an error or incorrect text?

Date fields in PDF forms are stored as text strings rather than numeric values. Adding a number directly to a text string causes a JavaScript error or simply appends the digit to the end of the text (e.g., 'Jan 1' becomes 'Jan 11'). You must use util.scand to parse it into a true Date object first.

What is the difference between LiveCycle and Acrobat date syntax?

Adobe LiveCycle relies on XML Forms Architecture (XFA) and typically uses FormCalc or a distinct JavaScript object model for calculations. Adobe Acrobat Pro DC relies on standard AcroForms using the Acrobat JavaScript API, which incorporates functions like util.scand and util.printd.

How do I change the date format output in my custom calculation script?

You can change the output format by modifying the format string passed into the util.printd() function. For example, changing "mmm d, yyyy" to "mm/dd/yyyy" will output dates in the format of 12/31/2023. Ensure your util.scand() format string continues to match the input field's format.