• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Automatic Date calculations for 90 days and 18 months from a fillable date field

New Here ,
Jan 12, 2021 Jan 12, 2021

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.

TOPICS
JavaScript

Views

740

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 12, 2021 Jan 12, 2021

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

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 22, 2021 Jan 22, 2021

Copy link to clipboard

Copied

There has to be an easier and better way than an article you published 15 years ago. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 22, 2021 Jan 22, 2021

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);
}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jan 23, 2021 Jan 23, 2021

Copy link to clipboard

Copied

LATEST

What is that suppose to do?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines