|
|
@ -191,19 +191,20 @@ export class DateTimeEditorComponent implements ControlValueAccessor, OnDestroy, |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private updateControls() { |
|
|
private updateControls() { |
|
|
if (!this.dateValue) { |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.suppressEvents = true; |
|
|
this.suppressEvents = true; |
|
|
|
|
|
|
|
|
if (this.timeValue && this.timeValue.isValid()) { |
|
|
if (this.timeValue && this.timeValue.isValid()) { |
|
|
this.timeControl.setValue(this.timeValue.format('HH:mm:ss'), { emitEvent: false }); |
|
|
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) { |
|
|
if (this.dateValue && this.dateValue.isValid() && this.picker) { |
|
|
this.dateControl.setValue(this.dateValue.format('YYYY-MM-DD'), { emitEvent: false }); |
|
|
this.dateControl.setValue(this.dateValue.format('YYYY-MM-DD'), { emitEvent: false }); |
|
|
|
|
|
|
|
|
this.picker.setMoment(this.dateValue); |
|
|
this.picker.setMoment(this.dateValue); |
|
|
|
|
|
} else { |
|
|
|
|
|
this.dateControl.setValue(null, { emitEvent: false }); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.suppressEvents = false; |
|
|
this.suppressEvents = false; |
|
|
|