From 778f5b47164d94111bb128600623705ba288b74e Mon Sep 17 00:00:00 2001 From: tykayn Date: Mon, 21 Mar 2022 13:50:38 +0100 Subject: [PATCH] put back leaving modal, and focus on hour choice when we add one for a day --- .../form/steps/step-four/step-four.component.html | 2 +- .../form/steps/step-four/step-four.component.ts | 13 ++----------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/app/features/administration/form/steps/step-four/step-four.component.html b/src/app/features/administration/form/steps/step-four/step-four.component.html index 3f558e0b..e422c00f 100644 --- a/src/app/features/administration/form/steps/step-four/step-four.component.html +++ b/src/app/features/administration/form/steps/step-four/step-four.component.html @@ -39,7 +39,7 @@
diff --git a/src/app/features/administration/form/steps/step-four/step-four.component.ts b/src/app/features/administration/form/steps/step-four/step-four.component.ts index 44bf652a..cb7f6b1e 100644 --- a/src/app/features/administration/form/steps/step-four/step-four.component.ts +++ b/src/app/features/administration/form/steps/step-four/step-four.component.ts @@ -51,25 +51,16 @@ export class StepFourComponent implements OnInit { }); } - addChoiceForDay(day_id, dayChoice: DateChoice): void { + addChoiceHourForDay(day_id, dayChoice: DateChoice): void { let lastDateChoice = this.pollService.dateChoiceList[this.pollService.dateChoiceList.length]; - let lastDateChoiceObject = this.dateUtilitiesService.addDaysToDate( - this.pollService.dateChoiceList.length, - new Date() - ); - if (lastDateChoice && lastDateChoice.date_object) { - lastDateChoiceObject = lastDateChoice.date_object; - } else { - lastDateChoiceObject = new Date(); - } dayChoice.timeSlices.push({ literal: '', }); dayChoice.timeSlices.sort((a: any, b: any) => { return a.date_object - b.date_object; }); - this.focusOnChoice(day_id, this.storageService.dateChoices.length - 1); + this.focusOnChoice(day_id, dayChoice.timeSlices.length - 1); } focusOnChoice(day_id, index): void {