ionic-team / ionic-framework

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
https://ionicframework.com
MIT License
51.02k stars 13.51k forks source link

ion-datepicker Use Icons with or instead of Text Labels #23106

Closed phillipa-llama closed 3 years ago

phillipa-llama commented 3 years ago

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.

image

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. image

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:

insert the output from ionic info here
liamdebeasi commented 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

ionitron-bot[bot] commented 3 years ago

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.