Browse Source

Date editor fixed

pull/250/head
Sebastian Stehle 9 years ago
parent
commit
04d38513cd
  1. 9
      src/Squidex/app/framework/angular/date-time-editor.component.ts

9
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;

Loading…
Cancel
Save