@jwieneke wrote:
Hi,
I try using pickerOptions of ion-datetime to create an additional clear button. Anyway only default buttons appear. Looking into datetime.js it seems like pickerOptions are handled as a string and not parsed correctly to an object. Could somebody have a look at the code and point me to what’s wrong there?
<ion-datetime displayFormat="DD.MM.YYYY" pickerFormat="DD MMM YYYY" monthShortNames="{{ 'DATE.MONTH_SHORT_NAMES' | translate }}" [(ngModel)]="dateValue" pickerOptions="{ buttons: [ { text: 'Clear', handler: (data: any) => { console.log('datetime, clear', data); } }] }" (ionChange)='onChange()'></ion-datetime>
https://plnkr.co/edit/c7J68cI6MzmY2f0h1XHU?p=preview
Additionaly two screenshots from debugging datetime.js.
Posts: 1
Participants: 1