From a2829334f4cfe0cf54f43dc460e55097c4541888 Mon Sep 17 00:00:00 2001 From: Alan Moore Date: Mon, 28 Jan 2019 14:23:12 +0100 Subject: [PATCH] Update validators.js new Date('wrong string') return a string 'Invalid Date' which is not usable with boolean negation. --- src/utils/validators.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/validators.js b/src/utils/validators.js index 26cfe5d8..20a46583 100644 --- a/src/utils/validators.js +++ b/src/utils/validators.js @@ -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)]; }