From 11768b16bfd09bf951ccd2fd9d76a3781e471527 Mon Sep 17 00:00:00 2001 From: HelderSepu Date: Fri, 22 Sep 2017 11:30:07 -0400 Subject: [PATCH] Correct IF for validateDateTime & validateGuid --- src/core/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/utils.js b/src/core/utils.js index 6ff31c29..9495d0fe 100644 --- a/src/core/utils.js +++ b/src/core/utils.js @@ -501,13 +501,13 @@ export const validateString = ( val ) => { } export const validateDateTime = (val) => { - if (val && typeof val !== "string") { + if (!isNaN(Date.parse(val))) { return "Value must be a DateTime" } } export const validateGuid = (val) => { - if (val && typeof val !== "string") { + if (!/^[{(]?[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}[)}]?$/.test(val)) { return "Value must be a Guid" } }