Skip to content

Commit

Permalink
Fix incorrect regular expression for checking the time format (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
cheton authored and roth1002 committed Sep 5, 2019
1 parent 89b0156 commit 090a042
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/TimeInput/lib/validate.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = function validate(val) {
return /^[0-2][0-9]:[0-5][0-9](:[0-5][0-9](:[0-9][0-9][0-9])?)?(\s+[ap]m)?$/i.test(val);
return /^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9](:[0-9][0-9][0-9])?)?(\s+[ap]m)?$/i.test(val);
};

0 comments on commit 090a042

Please sign in to comment.