Skip to main content
Participant
April 15, 2020
Question

Calculate the date of the Monday before a specific date

  • April 15, 2020
  • 1 reply
  • 292 views

My client wants to know if we can write a calculation script in a table of From/To boxes to pre-fill the boxes based on whatever is in the "Date of Injury" field (titled injury_field).

 

I believe the last "TO DATE" is the Monday prior to the Date of Injury. And then all the other dates work backward from there. (So each from/to dates need to be Mon-Sun)

 

Example: The injury_date is 04/15/2020. The Monday prior to that date is 04/13/2020 and I want that to auto-populate in the "to date" box once we fill in the injury_date.

 

 
This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
April 15, 2020

Yes, that is possible, but working with dates in JavaScript is not a trivial task.

These tutorials provide a very good starting point on the subject:

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

 

Alternatively, you can hire a professional developer to write this script for you. If you're interested in that option feel free to contact me privately via [try6767 at gmail.com].