Skip to content

Commit a282933

Browse files
authored
Update validators.js
new Date('wrong string') return a string 'Invalid Date' which is not usable with boolean negation.
1 parent fa934e8 commit a282933

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils/validators.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ const validators = {
149149
if (res != null) return res;
150150

151151
let m = new Date(value);
152-
if (!m) {
152+
if (isNaN(m.getDate())) {
153153
return [msg(messages.invalidDate)];
154154
}
155155

0 commit comments

Comments
 (0)