Skip to main content
Yellow Duckie
Participating Frequently
April 17, 2018
Resuelto

Arbitrary Mask with ante/post meridiem

  • April 17, 2018
  • 3 respuestas
  • 683 visualizaciones

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!

Este tema ha sido cerrado para respuestas.
Mejor respuesta de try67

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

3 respuestas

try67
Community Expert
try67Community ExpertRespuesta
Community Expert
April 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"...

Yellow Duckie
Participating Frequently
April 18, 2018

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.

Inspiring
April 17, 2018

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.