I want to disable future months and display only current month while selecting in UI, I am using p-calendar.
<p-calendar appendTo="body" class="SharesTblCalendar" name="closeDate"
[(ngModel)]="note.closeDate" [monthNavigator]="true" [yearNavigator]="true"
[yearRange]="yearRange"
</p-calendar>
this is the code I am using but couldnot resctric it from taking month
You can use maxDate to restrict calendar
<p-calendar appendTo="body" class="SharesTblCalendar" name="closeDate"
[(ngModel)]="note.closeDate" [monthNavigator]="true" [yearNavigator]="true"
[yearRange]="yearRange" [maxDate]="maxDate"
</p-calendar>
let today = new Date();
let month = today.getMonth();
this.maxDate = new Date();
this.maxDate.setMonth(month);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With