Fixed an issue in loading user details on the properties panel. Fixes #7287

This commit is contained in:
Nikhil Mohite 2022-04-05 11:19:24 +05:30 committed by Akshay Joshi
parent 4fff26c571
commit 56a4263a5c

View File

@ -223,6 +223,7 @@ const DATE_TIME_FORMAT = {
export function InputDateTimePicker({ value, onChange, readonly, controlProps, ...props }) { export function InputDateTimePicker({ value, onChange, readonly, controlProps, ...props }) {
let format = ''; let format = '';
let placeholder = ''; let placeholder = '';
let regExp = /[a-zA-Z]/;
if (controlProps?.pickerType === 'Date') { if (controlProps?.pickerType === 'Date') {
format = controlProps.format || DATE_TIME_FORMAT.DATE; format = controlProps.format || DATE_TIME_FORMAT.DATE;
placeholder = controlProps.placeholder || 'YYYY-MM-DD'; 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 should be a date object instead of string */
value = _.isUndefined(value) ? null : value; value = _.isUndefined(value) || regExp.test(value) ? null : value;
if (!_.isNull(value)) { if (!_.isNull(value)) {
let parseValue = DateFns.parse(value, format, new Date()); let parseValue = DateFns.parse(value, format, new Date());
if (!DateFns.isValid(parseValue)) { if (!DateFns.isValid(parseValue)) {