Calculating Time based off regular text fields

Community Beginner ,
Mar 01, 2018

Copy link to clipboard

Copied

Hello,

I am using text fields for time. My reason for this is because iPads tends to glitch out with PDF date/time formatted fields. iPads make it difficult to select a date/time because the pop-up field moves around/doesn't go away, even after selecting from the pop-up menu.

I would like to have a custom calculation that calculates the total time between "Arrive Job and "Leave Job".

As you can see in the screenshot below --

an example would be:

Arrive Job: 8 Hour 15 minutes AM

Leave Job: 1 Hour 15 minutes PM

I know that this equals 5 hours.

So i think the logic would be:

Arrive Job Hour + Arrive Job Minutes

(Leave Job Hour + Leave Job Minutes)  - would think that this should convert to military time if possible : so that If value = PM, and then if value = 12,1,2,3,4,5,6,7,8,9,10,11 - then subtract Arrive Job Total from Leave Job Total so 13 - 8 = 5.

If the example was:

Arrive Job: 8 Hours 15 minutes AM

Leave Job: 9 Hours 15 minutes AM

I know this equals 1 hours

So i think the logic would be:

Leave Job Total (subtract) Arrive Job Total = 1

Please let me know if this is possible -- or if there is another way to capture this data in an easier - please let me know.

I'm doing it in this way instead of having 1 field because I think that users would enter in their data in a variety of ways (8:00, 8, 800, 8;00, 8,00)

The users are construction workers and the process needs to be extremely easy and fool-proof.

TOPICS
Acrobat SDK and JavaScript

Views

43

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

Calculating Time based off regular text fields

Community Beginner ,
Mar 01, 2018

Copy link to clipboard

Copied

Hello,

I am using text fields for time. My reason for this is because iPads tends to glitch out with PDF date/time formatted fields. iPads make it difficult to select a date/time because the pop-up field moves around/doesn't go away, even after selecting from the pop-up menu.

I would like to have a custom calculation that calculates the total time between "Arrive Job and "Leave Job".

As you can see in the screenshot below --

an example would be:

Arrive Job: 8 Hour 15 minutes AM

Leave Job: 1 Hour 15 minutes PM

I know that this equals 5 hours.

So i think the logic would be:

Arrive Job Hour + Arrive Job Minutes

(Leave Job Hour + Leave Job Minutes)  - would think that this should convert to military time if possible : so that If value = PM, and then if value = 12,1,2,3,4,5,6,7,8,9,10,11 - then subtract Arrive Job Total from Leave Job Total so 13 - 8 = 5.

If the example was:

Arrive Job: 8 Hours 15 minutes AM

Leave Job: 9 Hours 15 minutes AM

I know this equals 1 hours

So i think the logic would be:

Leave Job Total (subtract) Arrive Job Total = 1

Please let me know if this is possible -- or if there is another way to capture this data in an easier - please let me know.

I'm doing it in this way instead of having 1 field because I think that users would enter in their data in a variety of ways (8:00, 8, 800, 8;00, 8,00)

The users are construction workers and the process needs to be extremely easy and fool-proof.

TOPICS
Acrobat SDK and JavaScript

Views

44

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
Mar 01, 2018 0

Have something to add?

Join the conversation