Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: ion-datetime When the [max] is set and [preferWheel], the number of days in the month does not change for the first time #29701

Open
3 tasks done
Archi-Od opened this issue Jul 9, 2024 · 0 comments
Labels

Comments

@Archi-Od
Copy link

Archi-Od commented Jul 9, 2024

Prerequisites

Ionic Framework Version

v7.x

Current Behavior

When the [max] is set and [preferWheel], and you change month, the number of days in the month does not change for the first time
For example, if you set the max date 16 years ago and today is July 10, then when you change a month back to June, the number of days remains 10 and not 30 (but if you change the month again, it is already drawn normally)

Expected Behavior

When the month changes, the number of days automatically changes

Steps to Reproduce

  1. In ion-dateTime set [preferWheel]="true"
  2. set [max]='maxDate' for example
    maxDate = sub(new Date(), { years: 16 }).toISOString();
    or without date-fns
    const today = new Date();
    const maxYear = today.getFullYear() - 16;
    const maxMonth = today.getMonth();
    const maxDay = today.getDate();
    this.maxDate = new Date(maxYear, maxMonth, maxDay).toISOString().split('T')[0];
  3. Change month

Code Reproduction URL

https://stackblitz.com/run?file=src%2Fapp%2Fexample.component.ts,src%2Fapp%2Fexample.component.html

Ionic Info

Ionic Framework : @ionic/angular 7.8.6
@angular-devkit/build-angular : 16.2.14
@angular-devkit/schematics : 16.2.14
@angular/cli : 16.2.14
@ionic/angular-toolkit : 9.0.0

Capacitor:

Capacitor CLI : 5.7.6
@capacitor/android : 5.7.6
@capacitor/core : 5.7.6
@capacitor/ios : 5.7.6

Utility:

cordova-res : not installed globally
native-run : 2.0.1

System:

NodeJS : v18.20.1
npm : 10.5.0
OS : Windows 10

Additional Information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants