From b843b4c4cc78e19a97e93d5007c6fc9d7d4cb7a7 Mon Sep 17 00:00:00 2001
From: Alex ORLUC <alex.orluc@maarch.org>
Date: Mon, 13 Jan 2020 17:24:20 +0100
Subject: [PATCH] FEAT #12091 TIME 0:05 fix empty full date

---
 src/frontend/plugins/fullDate.pipe.ts | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/frontend/plugins/fullDate.pipe.ts b/src/frontend/plugins/fullDate.pipe.ts
index 63c9d86eee2..97d56fa7e66 100755
--- a/src/frontend/plugins/fullDate.pipe.ts
+++ b/src/frontend/plugins/fullDate.pipe.ts
@@ -1,5 +1,6 @@
 import { Pipe, PipeTransform } from "@angular/core";
 import { LANG } from '../app/translate.component';
+import { FunctionsService } from "../service/functions.service";
 
 @Pipe({
 	name: 'fullDate',
@@ -7,10 +8,16 @@ import { LANG } from '../app/translate.component';
 })
 export class FullDatePipe implements PipeTransform {
 	lang: any = LANG;
-	constructor() { }
+	constructor(
+		public functions: FunctionsService
+	) { }
 	transform(value: string) {
-		const date = new Date(value);
-		const options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric', hour: 'numeric', minute: 'numeric' };
-		return this.lang.onRange[0].toUpperCase() + this.lang.onRange.substr(1).toLowerCase() + ' ' + date.toLocaleDateString(this.lang.langISO, options);
+		if (!this.functions.empty(value)) {
+			const date = new Date(value);
+			const options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric', hour: 'numeric', minute: 'numeric' };
+			return this.lang.onRange[0].toUpperCase() + this.lang.onRange.substr(1).toLowerCase() + ' ' + date.toLocaleDateString(this.lang.langISO, options);
+		} else {
+			return '';
+		}
 	}
 }
\ No newline at end of file
-- 
GitLab