ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

bug:

Open kharakAdhikari opened this issue 1 year ago • 1 comments

Prerequisites

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

kharakAdhikari avatar Aug 03 '22 11:08 kharakAdhikari

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

liamdebeasi avatar Aug 03 '22 13:08 liamdebeasi

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

kharakAdhikari avatar Aug 10 '22 08:08 kharakAdhikari

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.

liamdebeasi avatar Aug 10 '22 19:08 liamdebeasi

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.

ionitron-bot[bot] avatar Sep 11 '22 18:09 ionitron-bot[bot]