Pull request #403: RED-6122: Fix empty dates being saved as invalid.

Merge in RED/ui from RED-6122 to master

* commit '1b4f61e9604c272ef6fb7f235204c9d6170b5535':
  RED-6122: Fix empty dates being saved as invalid.
This commit is contained in:
George Balanesc 2023-02-20 14:20:19 +01:00 committed by Dan Percic
commit 38d44777a8

View File

@ -68,7 +68,7 @@ export class DocumentInfoDialogComponent extends BaseDialogComponent implements
const crtValue = formValue[key];
return {
...acc,
[key]: this._isDate(key) ? dayjs(crtValue).format('YYYY-MM-DD') : crtValue,
[key]: this._isDate(key) ? crtValue && dayjs(crtValue).format('YYYY-MM-DD') : crtValue,
};
}, {});
}