mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed an issue in loading user details on the properties panel. Fixes #7287
This commit is contained in:
parent
4fff26c571
commit
56a4263a5c
@ -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)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user