From cdaf12845f42cc023a8b6bfc565b19868b077bcf Mon Sep 17 00:00:00 2001 From: Florian Eisenmenger Date: Mon, 17 Jun 2024 12:30:59 +0200 Subject: [PATCH] task: set date field on edit --- .../src/app/_views/tasks/new-task/new-task.component.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/matsen-tool/src/app/_views/tasks/new-task/new-task.component.ts b/matsen-tool/src/app/_views/tasks/new-task/new-task.component.ts index c553b65..e5f82c6 100644 --- a/matsen-tool/src/app/_views/tasks/new-task/new-task.component.ts +++ b/matsen-tool/src/app/_views/tasks/new-task/new-task.component.ts @@ -74,6 +74,10 @@ export class NewTaskComponent implements OnInit, AfterViewInit { ngOnInit(): void { this.taskForm = FormGroupInitializer.initFormGroup(this.taskForm, this.task); + if (this.taskForm.get('dueAt')?.value !== null) { + this.taskForm.get('dueAt')?.setValue(this.taskForm.value.dueAt.slice(0, 10)); + this.dueAtValue = this.taskForm.get('dueAt')?.value; + } const prio = this.taskForm.get('prio'); // Set first radio checked if (prio && !prio.value) {