Highlighted

Need a Script to calculate weeks between two dates in fillable form

New Here ,
Dec 19, 2019

Copy link to clipboard

Copied

Hi,

 

I need some help with a script to generate the amount of weeks between two dates in a fillable form. I need the formula to work with the fillable form as they the dates will be different each time.

Im trying to get the amount of weeks to calculate from the two fillable areas in order to have the amount of hours per week in a project to calculate.

 

I have attached what it looks like so far to help.

 

Your help will be greatly appreciated!

 

 

Topics

PDF forms

Views

174

Likes

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

Need a Script to calculate weeks between two dates in fillable form

New Here ,
Dec 19, 2019

Copy link to clipboard

Copied

Hi,

 

I need some help with a script to generate the amount of weeks between two dates in a fillable form. I need the formula to work with the fillable form as they the dates will be different each time.

Im trying to get the amount of weeks to calculate from the two fillable areas in order to have the amount of hours per week in a project to calculate.

 

I have attached what it looks like so far to help.

 

Your help will be greatly appreciated!

 

 

Topics

PDF forms

Views

175

Likes

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
Most Valuable Participant ,
Dec 20, 2019

Copy link to clipboard

Copied

Maybe start by posting the script you already have...

Likes

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
Reply
Loading...
New Here ,
Dec 22, 2019

Copy link to clipboard

Copied

Hi,

 

I don't have any script at the moment. I've done alot of googling, but cant find anything that seems to work.

 

Likes

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
Reply
Loading...
try67 LATEST
Most Valuable Participant ,
Dec 23, 2019

Copy link to clipboard

Copied

OK. The way to do it is to convert both date strings to Date objects then calculate the difference between them in milliseconds, using the getTime method. Then you can convert that value to days or even directly to weeks.

See these tutorials for more information:

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

Likes

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
Reply
Loading...
Resources
Trending Issue & Solution
Edit PDF in Adobe Acrobat Pro DC