Help with auto filling dates and auto calculating time

Nov 03, 2020

Copy link to clipboard

Copied

I am trying to format a timesheet I have created for multiple departments in our office. I am wanting: 

1. Where the dates autofill when they select the period end date in the "WeekEndingDate" box (where the week ending date is a Sunday).

2. Auto calculate time to convert into quarter hours. I essentially want it to calculate like:

(MONDAYOUTLUNCH - MONDAYIN) + (MONDAYOUT-MONDAYINLUNCH) + "WorkFrom Home Hours" = "MONDAYTotal Daily" The employee would separate out their own time in the boxes named "MONDAYTotal Daily GL Hours" and "MONDAYTotal Daily Job Cost Hours"

I am not savvy with java scripts and the simple notations are not working.

 

defaultjniuap09kks0_0-1604411892081.png

 

TOPICS
Acrobat SDK and JavaScript, Create PDFs

Views

39

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

Help with auto filling dates and auto calculating time

Nov 03, 2020

Copy link to clipboard

Copied

I am trying to format a timesheet I have created for multiple departments in our office. I am wanting: 

1. Where the dates autofill when they select the period end date in the "WeekEndingDate" box (where the week ending date is a Sunday).

2. Auto calculate time to convert into quarter hours. I essentially want it to calculate like:

(MONDAYOUTLUNCH - MONDAYIN) + (MONDAYOUT-MONDAYINLUNCH) + "WorkFrom Home Hours" = "MONDAYTotal Daily" The employee would separate out their own time in the boxes named "MONDAYTotal Daily GL Hours" and "MONDAYTotal Daily Job Cost Hours"

I am not savvy with java scripts and the simple notations are not working.

 

defaultjniuap09kks0_0-1604411892081.png

 

TOPICS
Acrobat SDK and JavaScript, Create PDFs

Views

40

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
Nov 03, 2020 0
Adobe Community Professional ,
Nov 03, 2020

Copy link to clipboard

Copied

I think that you have a complicated PDF to work with.

 

Times and dates with JavaScript, specifically the parts that deal with date arithmetic, involve advanced scripting.

 

You can always get help here in the forums if you're willing to learn how to do your own scripts for your project.

 

But since you've mentioned that  you're not savvy with JavaScript scripting I would definitely recommend that you outsource a developer. Otherwise, maybe you could share an example of the file so that the community can  help you figure out what is wrong with the notations.

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...
Nov 03, 2020 0
try67 LATEST
Most Valuable Participant ,
Nov 04, 2020

Copy link to clipboard

Copied

As mentioned, this kind of calculation in Acrobat JS is not trivial.

I've developed a (paid-for) script that will allow you to set up such calculations quite easily:

http://try67.blogspot.com/2011/03/acrobat-calculate-time-differences-in.html

However, excluding the lunch time requires a more complex script, which I can also write for you, for a small fee.

If you're interested you can contact me privately via [try6767 at gmail.com] to discuss it further.

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...
Nov 04, 2020 1