Calculate military time to also include lunch and possible overnight shift

New Here ,
Apr 20, 2021 Apr 20, 2021

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. 

TOPICS
How to, JavaScript

Views

107

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
community guidelines
Adobe Employee ,
Apr 20, 2021 Apr 20, 2021

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

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
community guidelines
New Here ,
Apr 20, 2021 Apr 20, 2021

Copy link to clipboard

Copied

Amal, I only found one page (91) that talks about calculating. I need more direction than what it has. 

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
community guidelines
Most Valuable Participant ,
Apr 21, 2021 Apr 21, 2021

Copy link to clipboard

Copied

LATEST

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

 

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
community guidelines