Skip to content

Commit 4536097

Browse files
Copilotliweijie0812tdesign-bot
authored
fix(date-picker): fix the issue of incorrect month synchronization on the right panel (#6204)
* Initial plan * Changes before error encountered Co-authored-by: liweijie0812 <[email protected]> * chore: stash changelog [ci skip] * chore: stash changelog [ci skip] --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: liweijie0812 <[email protected]> Co-authored-by: tdesign-bot <[email protected]>
1 parent e81b519 commit 4536097

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

packages/components/date-picker/hooks/useRangeValue.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ export function useRangeValue(props: TdDateRangePickerProps) {
6767
if (year.value[1] < year.value[0]) {
6868
year.value[1] = year.value[0];
6969
}
70-
if (month.value[1] < month.value[0]) {
70+
// 只有当左右面板年份相同时,才需要比较月份大小
71+
if (year.value[0] === year.value[1] && month.value[1] < month.value[0]) {
7172
month.value[1] = month.value[0];
7273
}
7374
},
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
pr_number: 6204
3+
contributor: Copilot
4+
---
5+
6+
- fix(date-picker): 修复日期区间选择器跨年时右侧面板月份错误同步的问题 @liweijie0812 @Copilot ([#6204](https://github.com/Tencent/tdesign-vue-next/pull/6204))

0 commit comments

Comments
 (0)