Skip to main content
Participating Frequently
November 22, 2024
Question

Date Calculation

  • November 22, 2024
  • 1 reply
  • 607 views

I have looked at dozens of posts on calculating dates and have not been able to find one that fits my scenario.  I have a date field (EDD)  that I want to use to populate another date field (ECD) 280 days prior. I would also like to be able to calculate (GA) into weeks and days.  I have uploaded a pdf of what I have done in excel  but I need to be able to do this in Adobe.  I do have DC Pro.  Please help, I am still in the learning stages of javascript.

This topic has been closed for replies.

1 reply

PDF Automation Station
Community Expert
Community Expert
November 22, 2024

Enter the following custom calculation script in the ECD field:

var EDD=this.getField("EDD").value;
if(!EDD)
{event.value=""}
else
{
var date=util.scand("mm/dd/yyyy", EDD);
date.setDate(date.getDate()-280);
event.value=util.printd("mm/dd/yyyy",date);
}

What is GA?  Weeks and days of what?

dena_5624Author
Participating Frequently
November 22, 2024

GA is gestational Age based off today date and the EDD.  Is it possible in pdf?

PDF Automation Station
Community Expert
Community Expert
November 22, 2024

The difference between EDD and today's date in weeks and days?