Reputation: 5566
I am using p-calendar
I would like all past dates to be disabled
here is what I have :
<p-calendar formControlName="date" [inline]="true" tabindex="0" [disabledDates]="invalidDates" [disabledDays]="[0,6]"></p-calendar>
This is not working, what do I need to change to get the result I want ?
Upvotes: 9
Views: 11993
Reputation: 18281
The calendar has a minDate
input. Just set it to the current date, that way it cannot be lower than today.
In the code:
minimumDate = new Date();
In the template:
<p-calendar formControlName="date" [inline]="true" [minDate]="minimumDate" tabindex="0" [disabledDates]="invalidDates" [disabledDays]="[0,6]"></p-calendar>
Upvotes: 15