hsuanxyz / ion2-calendar

📅 A date picker components for ionic2 /ionic3 / ionic4
https://hsuanxyz.github.io/demo/ion2-calendar/
MIT License
555 stars 277 forks source link

onChange is not firing #260

Open Sireini opened 5 years ago

Sireini commented 5 years ago

Ionic version: (check one with "x") [ ] 2.x [ ] 3.x [x ] 4.x

Ion2-calendar mode: (check one with "x") [ x] components mode [ ] modal mode

I'm submitting a ... (check one with "x") [x ] bug report [ ] feature request [ ] help me

Current behavior:

onChange event is not getting triggert.

Expected behavior:

When changing a date I expect the onChange to fire.

Related code:

`<ion-calendar [(ngModel)]="date" (onChange)="onChange($event)" [format]="'YYYY-MM-DD'">

onChange(date) { console.log(date); this.getAvailability(date); }`

ypk46 commented 5 years ago

It seems like the Release Candidate version changed the output event to change instead of onChange. Try using this:

<ion-calendar [(ngModel)]="date"
(change)="onChange($event)"
[format]="'YYYY-MM-DD'">
radnaxel-a commented 4 years ago

Change the docs please, I spend 1 hour debugging this.

Kraloz commented 4 years ago

the npm package's readme has old documentation info for this event https://www.npmjs.com/package/ion2-calendar image image