JavaScript help for Dynamic Custom Stamp to make month appear in ALL CAPS
Hello,
I want to create a Custom Dynamic stamp that uses the current day’s date on the date the stamp is used, and shows the date using a 3-letter month in all caps, then the day, then the year: MMM dd, yyyy. For example, 1/1/2026 should show up as “JAN 01, 2026”
From Acrobat Pro DC (Ver 2026.001.21691), Win 11, I did the following:
- All tools > Add a stamp > Custom stamps > Create.
- In Select Image dialog, selected Browse to choose image > Open > OK
- In Create Custom Stamp dialog, selected Dynamic > entered Name for stamp > OK
- Navigated to newly created PDF stamp file and opened it: C:\Users\username\AppData\Roaming\Adobe\Acrobat\DC\Stamps > xxxxxxxxxxxxxxx.pdf
- With new stamp open, selected All tools > Prepare a form > Create form.
- Selected Text field, placed on stamp, switched to Select tool, double-clicked text field.
- In Text Field Properties dialog box, selected Calculate > Custom calculation script > Edit.
- In JavaScript Editor, I entered the following:
| var date = new Date(); var months = ["JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"]; var month = months[date.getMonth()]; event.value = (month + " " + date.getDate() + ", " + date.getFullYear()).toUpperCase(); |
While there are no apparent errors in this script, the date is showing up with only the first letter capitalized.
Instead of “JAN 1, 2026,” I’m getting “Jan 1, 2026”
I tried using one of the free AI chat bots, Gemini I think, and tried the different variations it generated, but noting worked to get the month to show up in all capital letters.
Is this not possible in Adobe? Is there an embedded field or code not allowing allcaps?
Thanks in advance for any help.
