From 1b4f61e9604c272ef6fb7f235204c9d6170b5535 Mon Sep 17 00:00:00 2001 From: George Date: Mon, 20 Feb 2023 15:17:34 +0200 Subject: [PATCH] RED-6122: Fix empty dates being saved as invalid. --- .../document-info-dialog/document-info-dialog.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/document-info-dialog/document-info-dialog.component.ts b/apps/red-ui/src/app/modules/file-preview/dialogs/document-info-dialog/document-info-dialog.component.ts index 23f5848e0..642ca91e3 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/document-info-dialog/document-info-dialog.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/document-info-dialog/document-info-dialog.component.ts @@ -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, }; }, {}); }