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

Fix:Datepicker disabledDate + monthRange does not behave as expected #2569

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

YannLynn
Copy link
Collaborator

@YannLynn YannLynn commented Nov 13, 2024

中文模板 / Chinese Template

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Test Case
  • TypeScript definition update
  • Document improve
  • CI/CD improve
  • Branch sync
  • Other, please describe:

PR description

Fixes #2567
点击前时间: 2024-11 到 2025-01
点击右侧面板的 2024 后,理论上时间会变为 2023-11 到 2024-01,此时命中了禁用区间所以无法跳转成功

修复逻辑如下 👇
如果进行某个年份选择,在 autoSelectMonth func 中,会对不符合要求的时间进行月份矫正,矫正到当前年月为非禁用态。
那么针对两个面板的时间可能出现以下 4 种状态

  1. 左 ✅,右 ✅。无需进行月份矫正。
  2. 左 ✅,右 ❌。仅右侧进行月份矫正。
  3. 左 ❌,右 ✅。仅右左侧进行月份矫正。
  4. 左 ❌,右 ❌。两个时间均进行月份矫正。

矫正方式为 对齐当前面板矫正后(如需)的时间。

Changelog

🇨🇳 Chinese

  • Fix: 修复 MonthRange DatePicker 在存在 disabledDate 情况下点击非禁用年份不跳转问题

🇺🇸 English

  • Fix: fix the issue that MonthRange DatePicker does not jump when clicking on a non-disabled year when there is a disabledDate

Checklist

  • Test or no need
  • Document or no need
  • Changelog or no need

Other

  • Skip Changelog

Additional information

Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 913f72e:

Sandbox Source
pr-story Configuration

Copy link

cypress bot commented Nov 13, 2024

semi-design    Run #2918

Run Properties:  status check passed Passed #2918  •  git commit 5a88ff76d2 ℹ️: Merge 913f72e7e7079b82c417b49fad4c589c75296bd6 into 55c43bb89487cc2971f4d9774435...
Project semi-design
Branch Review fix-2567
Run status status check passed Passed #2918
Run duration 07m 46s
Commit git commit 5a88ff76d2 ℹ️: Merge 913f72e7e7079b82c417b49fad4c589c75296bd6 into 55c43bb89487cc2971f4d9774435...
Committer YannLynn
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 11
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 275
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.
View all changes introduced in this branch ↗︎

@YannLynn YannLynn changed the title Fix 2567 Fix:Datepicker disabledDate + monthRange does not behave as expected Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Datepicker] disabledDate + monthRange does not behave as expected
1 participant