Reputation: 128
I am using a PrimeNg calendar to select multiple dates, and i bound the component to an array of dates using [(ngModel)]. When i select a date it's automatically pushed to the array but when i deselect a date it's always there.
Here is the calendar template :
<p-calendar name="DupDates" [(ngModel)]="DupDates" [dateFormat]="dateFormat"
[monthNavigator]="monthNavigator"
[locale]="calendarFr" [readonlyInput]="true" [inline]="true"
[maxDateCount]="4" [selectionMode]="multiple">
</p-calendar>
Upvotes: 1
Views: 3110
Reputation: 128
So apparently it's a bug in p-calendar, i didn't find any hack to fix it, i just removed the multiple selection and added the dates using onSelect
event.
Here's the link to the issue : https://github.com/primefaces/primeng/issues/3876
Upvotes: 1
Reputation: 6655
Remove square brackets from selectionMode
.
Replace [selectionMode]="multiple"
by selectionMode="multiple"
.
Upvotes: 1