Skip to content

Commit

Permalink
Update validators.js
Browse files Browse the repository at this point in the history
new Date('wrong string') return a string 'Invalid Date' which is not usable with boolean negation.
  • Loading branch information
SuPenguin committed Jan 28, 2019
1 parent fa934e8 commit a282933
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ const validators = {
if (res != null) return res;

let m = new Date(value);
if (!m) {
if (isNaN(m.getDate())) {
return [msg(messages.invalidDate)];
}

Expand Down

0 comments on commit a282933

Please sign in to comment.