Arbitrary Mask with ante/post meridiem

Explorer ,
Apr 17, 2018

Copy link to clipboard

Copied

I hope this isn't too weird a question, but I'm using an Arbitrary Mask for the time 99:99 so the user doesn't have to enter the colon themselves.

However, I was wondering if there's also a way to include either AM or PM in that mask.  I tried using 99:99 tt, but that simply added "tt" to the end of their entry.

If not, it's fine, but it would certainly help distinguish from any loopholes.

Thanks!

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

Since you're counting on the user to enter a valid hour anyway (they can enter 45:98 in your current set-up), you can also count on them to enter "am" or "pm" correctly, right? If so, then you can use this mask "99:99 AA"...

TOPICS
Acrobat SDK and JavaScript

Views

162

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

Arbitrary Mask with ante/post meridiem

Explorer ,
Apr 17, 2018

Copy link to clipboard

Copied

I hope this isn't too weird a question, but I'm using an Arbitrary Mask for the time 99:99 so the user doesn't have to enter the colon themselves.

However, I was wondering if there's also a way to include either AM or PM in that mask.  I tried using 99:99 tt, but that simply added "tt" to the end of their entry.

If not, it's fine, but it would certainly help distinguish from any loopholes.

Thanks!

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

Since you're counting on the user to enter a valid hour anyway (they can enter 45:98 in your current set-up), you can also count on them to enter "am" or "pm" correctly, right? If so, then you can use this mask "99:99 AA"...

TOPICS
Acrobat SDK and JavaScript

Views

163

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
Apr 17, 2018 0
Adobe Community Professional ,
Apr 17, 2018

Copy link to clipboard

Copied

No, but you can create custom keystroke, format, and validation scripts to perform this action. Also note that time string if this format have additional limitations to the allowed values by position within the string. The hours value can only be between 1 and inclusively unless there is a leading zero and minutes values can only be between 00 and 59.

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...
Apr 17, 2018 0
Most Valuable Participant ,
Apr 18, 2018

Copy link to clipboard

Copied

Since you're counting on the user to enter a valid hour anyway (they can enter 45:98 in your current set-up), you can also count on them to enter "am" or "pm" correctly, right? If so, then you can use this mask "99:99 AA"...

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...
Apr 18, 2018 0
Explorer ,
Apr 18, 2018

Copy link to clipboard

Copied

That's exactly what I needed!  Thanks try67.  I'm holding hope on the fact that this being an official document, the user must enter a valid time to be approved/accepted.  The ante/post meridiem helps distinguish precisely just that.

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...
Apr 18, 2018 0