Skip to content

Commit 11768b1

Browse files
committed
Correct IF for validateDateTime & validateGuid
1 parent 85b7b72 commit 11768b1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/core/utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,13 +501,13 @@ export const validateString = ( val ) => {
501501
}
502502

503503
export const validateDateTime = (val) => {
504-
if (val && typeof val !== "string") {
504+
if (!isNaN(Date.parse(val))) {
505505
return "Value must be a DateTime"
506506
}
507507
}
508508

509509
export const validateGuid = (val) => {
510-
if (val && typeof val !== "string") {
510+
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)) {
511511
return "Value must be a Guid"
512512
}
513513
}

0 commit comments

Comments
 (0)