ionic-team / ionic-team/ionic-framework

bug: max value changes when selecting the 31st and changing the month through the wheel

Open
#29,124 1 comment 0 reactions 0 assignees View on GitHub
package: core type: bug
Dominant language
TypeScript
Stars
52.7k
Forks
13.3k
Avg merge
1d 15h
Merged PRs (30d)
51

Description

### Prerequisites

- [X] I have read the [Contributing Guidelines](https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#creating-an-issue).
- [X] I agree to follow the [Code of Conduct](https://ionicframework.com/code-of-conduct).
- [X] I have searched for [existing issues](https://github.com/ionic-team/ionic-framework/issues) that already report this problem, without success.

### 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_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.