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.01k stars 13.51k forks source link

bug: ion-datetime month and year changes when trying to select a date on none english locale #26992

Closed eranf91 closed 1 year ago

eranf91 commented 1 year ago

Prerequisites

https://user-images.githubusercontent.com/23518521/226718776-8e45ed76-be8f-4f13-b3a8-96c92b1c7806.mp4

Ionic Framework Version

v6.x

Current Behavior

when configuring a device or browser on none English locale, the ion-date-time is completely unstable, clicking the day, changes the month to the previous one.

Expected Behavior

month should be changed only when user wants to change it and by using the relevant dialog.

Steps to Reproduce

  1. put the following in the html (with relevant fixes:

  2. ` <ion-item (click)="showPicker = !showPicker">

    title {{ date }}

    <ion-datetime *ngIf="showPicker" presentation="date" [value]="date" size="cover" (ionChange)="updateValue($event)">`

  3. start the project with the none english locale (in my case it was Hebrew)

  4. start play with component and see for the strange behavior.

Code Reproduction URL

No response

Ionic Info

"@ionic-native/fcm": "5.36.0",
"@ionic-native/globalization": "5.36.0",
"@ionic-native/in-app-browser": "5.36.0",
"@ionic-native/splash-screen": "5.36.0",
"@ionic-native/status-bar": "5.36.0",
"@ionic/angular": "6.6.2",

Additional Information

angular version: "@angular/animations": "12.2.17", "@angular/common": "12.2.17", "@angular/core": "12.2.17", "@angular/forms": "12.2.17", "@angular/platform-browser": "12.2.17", "@angular/platform-browser-dynamic": "12.2.17", "@angular/router": "12.2.17",

ionitron-bot[bot] commented 1 year ago

Thanks for the issue! This issue has been labeled as needs reproduction. This label is added to issues that need a code reproduction.

Please reproduce this issue in an Ionic starter application and provide a way for us to access it (GitHub repo, StackBlitz, etc). Without a reliable code reproduction, it is unlikely we will be able to resolve the issue, leading to it being closed.

If you have already provided a code snippet and are seeing this message, it is likely that the code snippet was not enough for our team to reproduce the issue.

For a guide on how to create a good reproduction, see our Contributing Guide.

averyjohnston commented 1 year ago

This issue is being closed due to lack of a reproduction. If this is still a problem in the latest version of Ionic, please open a new issue and ensure the template is fully filled out. Thank you!