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

Arbitrary Mask with ante/post meridiem

Explorer ,
Apr 17, 2018 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!

TOPICS
Acrobat SDK and JavaScript

Views

467

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

correct answers 1 Correct answer

Community Expert , Apr 18, 2018 Apr 18, 2018

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"...

Votes

Translate

Translate
LEGEND ,
Apr 17, 2018 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.

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

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

Copy link to clipboard

Copied

LATEST

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.

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