Copy link to clipboard
Copied
I am designing a fillable PDF Document and I need it to automatically fill in two dates calculated from another fillable date field. It will be one 90 days and another 18 Months from the date entered into the first field.
The first field is named "D Date", the second is named "+90", and the third is named "+18". Thanks for any assistance. Cheers.
Copy link to clipboard
Copied
Working with dates in JS is not trivial. You can learn how to do it in these tutorials:
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-date-and-time-acrobat-javascript-part-3-3
Or you can use this (paid-for) tool I've developed to easily set up these calculations, without having to write any code:
https://www.try67.com/tool/acrobat-apply-automatic-date-calculation
Copy link to clipboard
Copied
There has to be an easier and better way than an article you published 15 years ago.
Copy link to clipboard
Copied
This is what I just used based on another users answer on another question.
var cDate = this.getField("Today Date_af_date").value;
if (cDate) {
var d1 = new Date();
d1 = util.scand("mm/dd/yyyy", cDate);
d1.setFullYear(d1.getFullYear(), d1.getMonth()+3, d1.getDate()-1);
event.value = util.printd("mm/dd/yyyy", d1);
}
Copy link to clipboard
Copied
What is that suppose to do?