Correction time regex in the add Methods #131

Closed
tiagofaustino opened this Issue Jun 17, 2011 · 2 comments

Comments

Projects
None yet
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

This comment has been minimized.

Show comment
Hide comment
@gmile

gmile Jul 12, 2011

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

gmile commented Jul 12, 2011

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

@mlynch

This comment has been minimized.

Show comment
Hide comment
@mlynch

mlynch May 5, 2012

Contributor

The regex I actually settled on is

^([0-1][0-9]|2[0-3]):([0-5][0-9])$
Contributor

mlynch commented May 5, 2012

The regex I actually settled on is

^([0-1][0-9]|2[0-3]):([0-5][0-9])$

@mlynch mlynch closed this in 851e941 May 7, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment