1

I am using ion2-calendar version 3.5.0

without implementing the monthChange event it is working fine, but when I add like this:

<ion-calendar [options]="cal_options" [(ngModel)]="selectedDates" (monthChange)="onMonthChanged($event)" (change)="onChange($event)">
</ion-calendar>

On month change function:

 onMonthChanged(month) {
  this.selectedMonth = month.newMonth.months;
 }

When I switch month, it keeps displaying the current month

Images attached: enter image description here

enter image description here

Hadia
  • 11
  • 3

1 Answers1

0

This is how I got my selected month, I hope this will be helpful

onMonthChanged($event: any) { const newMonthArr = $event.newMonth.string.split('-'); const [year, month, day] = newMonthArr; console.log(month); }`