Copy link to clipboard
Copied
I am creating a time sheet and need help with writing a script. The script needs to have a start time and an end time. It needs to also include a lunch time. There will also be instances where the time could start on one day and go over into the next day.
Copy link to clipboard
Copied
Hi Tracy
Hope you are doing well and sorry for the trouble. As described you need help with a script.
Please check out the help page: https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/js_developer_guide.pdf and see if that helps.
Regards
Amal
Copy link to clipboard
Copied
Amal, I only found one page (91) that talks about calculating. I need more direction than what it has.
Copy link to clipboard
Copied
Performing date and time calculations in Acrobat JS is not a trivial task.
See these tutorials for more info:
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
If you're interested, I've developed a (paid-for) tool that allows you to do something very similar to what you described, without having to write any code, and I can customize it to your specific needs. You can find it here:
https://www.try67.com/tool/acrobat-calculate-time-differences-in-a-worksheet