fix(calendar): fix calendar range issues #3759
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

🤔 这个 PR 的性质是?
🔗 相关 Issue
💡 需求背景和解决方案
代码缺陷
其一,组件源码中的月份禁用选项生成依据仅为先起始年份后终止年份的单侧判断
只有在切换年份时才会触发月份的禁用选项更新。当起止年份相同时(假定为2025年),若年份选中
2025年,以上逻辑仅会判断当前选中项与起始年份相同然后禁用起始月份之前的月份选项,而忽略对终止月份之后的月份选项的禁用其二,生成年份选项时多余且错误地调用了
checkMonthAndYearSelectorDisabled函数来判断年份选项的禁用状态。年份选项生成一定在范围内,无需额外编写禁用状态逻辑;且checkMonthAndYearSelectorDisabled函数是用于月份选项禁用范围的判定,用于年份选项会导致实际可选择范围异常解决方案
其一,
将可复用的月份处理逻辑提前,然后在单侧判断之前增加一个分支逻辑判断起止年份是否相同,相同的话将禁用的月份选项设定为在起止月份之外的即可
其二,删去多余的禁用状态逻辑,固定启用所有年份选项
📝 更新日志
fix(calendar): 修复了当设定日历的range值为同一年内时,终止月份之后的月份选项没有正常禁用的问题
fix(calendar): 修复了年份选项错误地使用了月份选项禁用范围判定逻辑的问题
本条 PR 不需要纳入 Changelog
☑️ 请求合并前的自查清单