From 04d38513cdbfd045c372510199e9583643d27f18 Mon Sep 17 00:00:00 2001 From: Sebastian Stehle Date: Tue, 13 Feb 2018 20:21:11 +0100 Subject: [PATCH] Date editor fixed --- .../app/framework/angular/date-time-editor.component.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Squidex/app/framework/angular/date-time-editor.component.ts b/src/Squidex/app/framework/angular/date-time-editor.component.ts index ad6103174..024d73b1d 100644 --- a/src/Squidex/app/framework/angular/date-time-editor.component.ts +++ b/src/Squidex/app/framework/angular/date-time-editor.component.ts @@ -191,19 +191,20 @@ export class DateTimeEditorComponent implements ControlValueAccessor, OnDestroy, } private updateControls() { - if (!this.dateValue) { - return; - } - this.suppressEvents = true; if (this.timeValue && this.timeValue.isValid()) { this.timeControl.setValue(this.timeValue.format('HH:mm:ss'), { emitEvent: false }); + } else { + this.timeControl.setValue(null, { emitEvent: false }); } + if (this.dateValue && this.dateValue.isValid() && this.picker) { this.dateControl.setValue(this.dateValue.format('YYYY-MM-DD'), { emitEvent: false }); this.picker.setMoment(this.dateValue); + } else { + this.dateControl.setValue(null, { emitEvent: false }); } this.suppressEvents = false;