Hello,
I want to create a text field with a validation rule. The object is for fitness tests and the field is mile time. Basically, I want the field to only be able to be in a TIME format, but the times could range anywhere from 5:00 to 20:00+. I'd like for them to not have to enter a leading zero for a single digit time number (such as 05:00). So the time could have two numbers before the colon or just one (5:00 versus 13:00).
Any ideas?
Thank you!
7 件の回答
How about this for a validation rule:
NOT(REGEX(Your_Field__c , "[\\d]{1,2}:[0-5]{1}[0-9]{1}"))
The regex checks 1-2 digits, then a : character, then a digit 0-5, then a digit 0-9