Customize Datetime's Picker

Hi,

I am trying to customize the picker that appears when we click on the DateTime component (native component). I saw that we can use an “pickerOptions” but I’ve got an error :confused:

Is there any remedy for this issue?

The source code is below:
ion-datetime classe=“date” mode=“ios” displayFormat="{{displayFormat}}" pickerFormat="{{pickerFormat}}" pickerOptions="{{optionsDatePicker}}" min="{{min}}" max="{{max}}" [(ngModel)]=“reportingDate” (ionChange)=‘onDatePicked()’

And I had this error:
Cannot create property ‘columns’ on string ‘[object Object]’

Thank you four your time.

Regards,

Gaëtan

after some struggles with the same error I was able to get this to work:

[pickerOptions]='{enableBackdropDismiss: false}'

When you’re binding to strings, these two are equivalent:

foo="{{bar}}"
[foo]="bar"

When you’re binding to anything else, you must use the second syntax, and therefore I recommend simply getting in the habit of preferring it over the first option in all cases.

1 Like