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 }} +