ionic-team / ionic-team/ionic-framework

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

未关闭
#29,124 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
package: core type: bug
主要语言
TypeScript
星标
52.7k
派生
13.3k
平均合并
1 天 15 小时
30 天内合并 PR
51

描述

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

贡献指南

打开贡献指南

调研方向

Start with the linked StackBlitz reproduction and the ion-datetime component, reproducing the March 31 to April month-wheel transition with the stated min and max values. Trace the date-time picker’s month selection and min/max handling; done means April selects the maximum allowed date while later dates remain greyed out.

由索引模型根据 Issue 内容生成。

评估

技术栈
angular, typescript
领域
frontend
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。