Error while switching selection mode on primeng calendar

Viewed 173

I am trying to build a calendar component based on primeng that allows a user to switch between single day selection mode, and multi day selection mode. The problem is that when I switch into multi select mode while selecting a day, I get an error like this:

this.value is not iterable

When I dug into the primeng I realized that when I switch modes and reset my ngModel that value is not taking into consideration so it tries to loop through a date object (which explains the error ^^' ). Do you guys have any tips for me here? Anything is appreciated.

PS: here is my calendar tag :

<p-calendar #calendar
        [selectionMode]="calendarMode"
        [appendTo]="'body'"
        [inline]="true"
        [showButtonBar]="false"
        (onMonthChange)="emitMonth($event)"
        [(ngModel)]="dataDate"
        (ngModelChange)="emitDate()"
        [showOtherMonths]="false"> </p-calendar>
0 Answers
Related