• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Help with auto filling dates and auto calculating time

New Here ,
Nov 03, 2020 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

Views

378

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
Community Expert ,
Nov 03, 2020 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.

Votes

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
Community Expert ,
Nov 04, 2020 Nov 04, 2020

Copy link to clipboard

Copied

LATEST

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.

Votes

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