Skip to main content
Inspiring
February 26, 2018
Question

Calculation of two calendar dates

  • February 26, 2018
  • 1 reply
  • 523 views

Hi,

Is it possible to calculate the number of days form 2 calendar dates using the acrobat forms calendar, i.e the date of departure & the date of return = X amount of days

thanks

Paul

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
February 26, 2018

Sure. You would need to convert the values of the fields to Date objects and then subtract them from one another to get the difference between them in milliseconds, which you could then convert to full days.

See these tutorials about this 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-with-date-and-time-in-acrobat-javascript-part-3