Skip to content

Commit 090a042

Browse files
chetonroth1002
authored andcommitted
Fix incorrect regular expression for checking the time format (#9)
1 parent 89b0156 commit 090a042

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/TimeInput/lib/validate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = function validate(val) {
2-
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);
2+
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);
33
};

0 commit comments

Comments
 (0)