Skip to content

Loading…

Correction time regex in the add Methods #131

Closed
tiagofaustino opened this Issue · 2 comments

3 participants

@tiagofaustino

Archive: http://ajax.aspnetcdn.com/ajax/jquery.validate/1.8.1/additional-methods.js

The regex was this way above:

/^([01][0-9])|(2[0123]):([0-5])([0-9])$/

If you enter "12" for example, it returns true.

I propose this new regex:

/^([0-1][0-9]|[2][0-3])(:([0-5][0-9])){1,2}$/
@gmile

Good catch. Can you make a pull request with patch and a test case?

@mlynch

The regex I actually settled on is

^([0-1][0-9]|2[0-3]):([0-5][0-9])$
@mlynch mlynch closed this in 851e941
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.