Reputation: 5039
I am little weak in regular expression. Can anybody help me in finding regular expression for time (in 24 hour format) in extjs
Thank you.
Upvotes: 0
Views: 552
Reputation: 6995
Don't reinvent the wheel if you don't have to. The fine folks at Sencha went through a lot of trouble so that developers like us don't have to mess with this sort of thing.
// returns null if parse failed, or Date object is successful
var mydate = Ext.Date.parse(inputString, "G:i");
For more information, check the API docs for Ext.Date
Upvotes: 1
Reputation: 704
Try out
^(20|21|22|23|[01]\d|\d)(([:][0-5]\d){1,2})$
or you can use
([01]?[0-9]|2[0-3]):[0-5][0-9]
For more info visit tutorial
Upvotes: 0
Reputation: 1200
This might be what you are looking for:
'/^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/'
Not sure if it works on extis, if not you can always translate it back to the syntax uses in extis.
Upvotes: 0