Copy link to clipboard
Copied
I am trying to create a due date that is based on a drop down list and todays date. Example: Drop down selection is 30, 60 or 90 days. Todays date Nov 15, 2019. When drop selection is 30, I want the Due Date to populate with the date for Dec 15, 2019 (30 days from today)
I got some what there wiht the Value Calculate but the Due Date field is showing as NAN.
Is there a script I am missing or formating the cells incorrectly? Appreicate the help 🙂
Copy link to clipboard
Copied
Hi,
Can you share the script that you suspect is not populating the projected date?
If some fields are getting the right answer but not others, have you checked for typos in your script?
Copy link to clipboard
Copied
Hi,
I actually didn't use a script. Under the properties for the Due Date i used the calculate cells. Interval Date + Todays Date. I have the values for the Intervals set up 30, 60, 90 and todays date entered as mm/dd/yyyy
Copy link to clipboard
Copied
Unfortunately date calculations don't work this way.
You'll need to use a script. You can read all about it here:
https://acrobatusers.com/tutorials/date_time_part1
Copy link to clipboard
Copied
The date values you are working with are character strings and not numeric strings. The "+" operator for character strings performs the concatenation, joining, of the 2 strings and not adding the numeric values of the string. PDF and its associated JavaScript Date and Time object assigns a unique value to each millisecond and hence each date ant time. This object has many properties and many methods that let one compare, adjust, rank, etc each date and time value. As one manipulates a date object by either days or months the months and years are automatically adjusted bases on the number of days for the specific month, including adjustments for the added day in February of leap years/centuries. The Date and Time object also adjusts for Day Light Saving Time changes base on one's computer settings.