Closed phillipa-llama closed 3 years ago
Thanks for the issue. I am adding your feature request to our datetime issue tracker here: https://github.com/ionic-team/ionic-framework/issues/16630
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Ionic version:
[] 4.x [x] 5.x
I'm submitting a ...
[ ] bug report [x] feature request
Current behavior:
Currently I am able to send custom PickerOption buttons into the ion-datetime component. However, I'd like to be able to include an icon with these or use an icon instead of the text label altogether. Currently there doesn't seem to be a way to do this.
Expected behavior:
As an example, I would like the options to replace the Close / Done / Any buttons with a relevant icon. I would also like the ability to have both an icon and a label for the button.
Steps to reproduce:
N/A
Related code:
this.customPickerOptions = { buttons: [ { text: 'Switch Calendar', cssClass: 'switch-btn', handler: () => { this.switchCalendar(); } }, { text: 'Cancel', handler: () => { } }, { text: 'Done', handler: (value) => { } } ] }
<ion-datetime #dateTimePicker [pickerOptions]="customPickerOptions" formControlName="validDate" displayFormat="DD MMM YYYY" [min]="getToday('YYYY-MM-DD')" [max]="getMaxValidDate()"></ion-datetime>
Other information:
Ionic info: