From d538af4ca1ff9be6e6da6a50874cea7587f2e8f1 Mon Sep 17 00:00:00 2001 From: Tykayn Date: Tue, 16 Nov 2021 17:30:31 +0100 Subject: [PATCH] style calendar step --- src/app/core/services/poll.service.ts | 5 ++ .../step-three/step-three.component.html | 14 ++++-- .../steps/step-three/step-three.component.ts | 1 + src/assets/i18n/FR.json | 48 +++++++++---------- src/styles/partials/_forms.scss | 24 +++++++++- 5 files changed, 64 insertions(+), 28 deletions(-) diff --git a/src/app/core/services/poll.service.ts b/src/app/core/services/poll.service.ts index d8ed77f7..a1e7d8b0 100644 --- a/src/app/core/services/poll.service.ts +++ b/src/app/core/services/poll.service.ts @@ -48,6 +48,7 @@ export class PollService implements Resolve { public allowSeveralHours = false; public richTextMode = false; public calendar: Date[] = [new Date()]; + public disabled_dates: Date[] = []; constructor( private http: HttpClient, @@ -71,6 +72,10 @@ export class PollService implements Resolve { this.DateUtilitiesService.addDaysToDate(2, new Date()), this.DateUtilitiesService.addDaysToDate(3, new Date()), ]; + // disable days before today + for (let i = 1; i < 31; i++) { + this.disabled_dates.push(this.DateUtilitiesService.addDaysToDate(-i, new Date())); + } if (environment.autofill_creation) { this.setDemoValues(); this.toastService.display('auto fill de création fait'); diff --git a/src/app/features/administration/form/steps/step-three/step-three.component.html b/src/app/features/administration/form/steps/step-three/step-three.component.html index 3e3da6d6..fa8f3aec 100644 --- a/src/app/features/administration/form/steps/step-three/step-three.component.html +++ b/src/app/features/administration/form/steps/step-three/step-three.component.html @@ -6,18 +6,23 @@ {{ pollService.calendar.length }} - {{ 'dates.count_dates' | translate }} -
+ +
+
@@ -32,6 +37,9 @@ {{ 'dates.add_time' | translate }} +