From c98687d6f08ea3f635c9980d46358a750c8baf31 Mon Sep 17 00:00:00 2001 From: davidcanonieto Date: Fri, 19 Jul 2019 12:51:10 +0100 Subject: [PATCH] [ADF-4754] Fix Date Widget display value (#4945) --- lib/core/form/components/widgets/date-time/date-time.widget.ts | 2 +- lib/core/form/components/widgets/date/date.widget.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/core/form/components/widgets/date-time/date-time.widget.ts b/lib/core/form/components/widgets/date-time/date-time.widget.ts index 93003aa924..1cdcfac80b 100644 --- a/lib/core/form/components/widgets/date-time/date-time.widget.ts +++ b/lib/core/form/components/widgets/date-time/date-time.widget.ts @@ -75,7 +75,7 @@ export class DateTimeWidgetComponent extends WidgetComponent implements OnInit, this.maxDate = moment(this.field.maxValue, 'YYYY-MM-DDTHH:mm:ssZ'); } } - this.displayDate = moment(this.field.value); + this.displayDate = moment(this.field.value, this.field.dateDisplayFormat); } ngOnDestroy() { diff --git a/lib/core/form/components/widgets/date/date.widget.ts b/lib/core/form/components/widgets/date/date.widget.ts index 5de5b0927f..37198a378c 100644 --- a/lib/core/form/components/widgets/date/date.widget.ts +++ b/lib/core/form/components/widgets/date/date.widget.ts @@ -73,7 +73,7 @@ export class DateWidgetComponent extends WidgetComponent implements OnInit, OnDe this.maxDate = moment(this.field.maxValue, this.DATE_FORMAT); } } - this.displayDate = moment(this.field.value); + this.displayDate = moment(this.field.value, this.field.dateDisplayFormat); } ngOnDestroy() {