From 56a4263a5cd4d6f6436bf6fd884a0bec3c4151f9 Mon Sep 17 00:00:00 2001 From: Nikhil Mohite Date: Tue, 5 Apr 2022 11:19:24 +0530 Subject: [PATCH] Fixed an issue in loading user details on the properties panel. Fixes #7287 --- web/pgadmin/static/js/components/FormComponents.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/pgadmin/static/js/components/FormComponents.jsx b/web/pgadmin/static/js/components/FormComponents.jsx index 0436b6c3a..1e425215c 100644 --- a/web/pgadmin/static/js/components/FormComponents.jsx +++ b/web/pgadmin/static/js/components/FormComponents.jsx @@ -223,6 +223,7 @@ const DATE_TIME_FORMAT = { export function InputDateTimePicker({ value, onChange, readonly, controlProps, ...props }) { let format = ''; let placeholder = ''; + let regExp = /[a-zA-Z]/; if (controlProps?.pickerType === 'Date') { format = controlProps.format || DATE_TIME_FORMAT.DATE; placeholder = controlProps.placeholder || 'YYYY-MM-DD'; @@ -239,7 +240,7 @@ export function InputDateTimePicker({ value, onChange, readonly, controlProps, . }; /* Value should be a date object instead of string */ - value = _.isUndefined(value) ? null : value; + value = _.isUndefined(value) || regExp.test(value) ? null : value; if (!_.isNull(value)) { let parseValue = DateFns.parse(value, format, new Date()); if (!DateFns.isValid(parseValue)) {