ionic-framework
ionic-framework copied to clipboard
bug:
Prerequisites
- [X] I have read the Contributing Guidelines.
- [X] I agree to follow the Code of Conduct.
- [X] I have searched for existing issues that already report this problem, without success.
Ionic Framework Version
- [ ] v4.x
- [ ] v5.x
- [X] v6.x
- [ ] Nightly
Current Behavior
I am upgrading ionic 5 to ionic 6 in my angular 13 application. In ionic 5 there is an input property monthShortNames for ion-datetime but that property does not exist in ion-datetime in ionic 6. Is there a way I can display short(jan/feb/mar) month names in ion-datetime while using ionic 6?
I'm using these versions: Nodejs: 14.15.4 Angular: 13.1.1 npm: 8.1.0
- Thanks
Expected Behavior
ion-datetime should be able to display short(jan/feb/march etc) month names in ionic 6
Steps to Reproduce
ion-datetime doesn't have monthShortNames property in ionic 6
Code Reproduction URL
No response
Ionic Info
Ionic CLI : 6.19.0 (/usr/local/lib/node_modules/@ionic/cli) Ionic Framework : @ionic/angular 6.2.0 @angular-devkit/build-angular : 13.1.2 @angular-devkit/schematics : 13.1.2 @angular/cli : 13.1.2 @ionic/angular-toolkit : 6.1.0
Additional Information
No response
Thanks for the issue. With Ionic 6 the datetime is able to automatically localize the month names. As a result, monthShortNames
is no longer needed. See https://ionicframework.com/docs/api/datetime#wheel-style-pickers for an example.
However, a limitation is that this only works for locales supported by the browser. We have an open feature request for adding locales not supported by the browser (for example, Tatar language with Latin symbols).
Thanks @liamdebeasi. Is there any property in ion-datetime to display months names in numbers(1,2,3....upto 12 instead of january, february etc) for presentation="date" and preferWheel="true" ?
Thanks
No, we do not have that functionality. The goal of ion-datetime
is to present a date selection interface using terminology that the end user is familiar with. In this case, we made the decision to render month names (January, February, March, etc). This also helps align the component with some native date pickers on iOS and Android.
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.