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: max value changes when selecting the 31st and changing the month through the wheel #29124

Open
3 tasks done
porojanmadalin opened this issue Mar 7, 2024 · 1 comment
Open
3 tasks done
Labels
package: core @ionic/core package type: bug a confirmed bug report

Comments

@porojanmadalin
Copy link

porojanmadalin commented Mar 7, 2024

Prerequisites

Ionic Framework Version

v7.x

Current Behavior

When selecting the next month from the date-time picker that has the min and max values set, and the max is lower than the number of days of previous month, the max value is ignored completely and the next month values are not greyed out anymore. The calendar is broken and only page refresh fixes it.

Expected Behavior

The calendar should select the max date from the next month and leave the other dates greyed out.

Steps to Reproduce

  1. Use ionic ion-datetime component
  2. Set min attribute to 2024-03-01T00:00:00
  3. Set max attribute to 2024-04-20T23:59:59
  4. Set value attribute to any day from March
  5. Select 31 March from date picker
  6. Choose April from month wheel
  7. Close month wheel

Code Reproduction URL

https://stackblitz.com/edit/angular-e3blvt-fwbheo?file=src%2Fapp%2Fexample.component.html

Ionic Info

"@angular/core": "17.0.1",
"@angular/forms": "17.0.1",
"@angular/common": "17.0.1",
"@angular/router": "17.0.1",
"@angular/compiler": "17.0.1",
"@angular/animations": "17.0.1",
"@angular/platform-browser": "17.0.1",
"@ionic/angular": "7.7.4",
"@ionic/core": "7.7.4",

Additional Information

No response

@thetaPC
Copy link
Contributor

thetaPC commented Mar 8, 2024

Thank you for submitting the issue!

I was able to replicate the issue. This is happening when the user selects the 31st and then switches the month through the wheel. This leads to the maxParts being updated to the last day of the newly selected month instead of the original max. We'll look into this as soon as we can.

@thetaPC thetaPC added package: core @ionic/core package type: bug a confirmed bug report and removed triage labels Mar 8, 2024
@thetaPC thetaPC removed their assignment Mar 8, 2024
@thetaPC thetaPC changed the title bug: Clamp date between min and max when using month picker does not work accordingly bug: max value changes when selecting the 31st and changing the month through the wheel Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: core @ionic/core package type: bug a confirmed bug report
Projects
None yet
Development

No branches or pull requests

2 participants