Skip to content

Commit 72e931d

Browse files
committed
fix(calendar): 修正错误使用的rangeFromTo
1 parent b225261 commit 72e931d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/components/calendar/Calendar.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,11 @@ const Calendar = forwardRef<CalendarMethods, CalendarProps>((props, ref) => {
193193
const checkMonthSelectorDisabled = (yearIn: number, monthIn: number): boolean => {
194194
if (isRangeValid) {
195195
// 读取起止年份
196-
const beginYear = dayjs(rangeFromTo.value.from).year();
197-
const endYear = dayjs(rangeFromTo.value.to).year();
196+
const beginYear = dayjs(rangeFromTo.from).year();
197+
const endYear = dayjs(rangeFromTo.to).year();
198198
// 读取起止月份
199-
const beginMon = parseInt(dayjs(rangeFromTo.value.from).format('M'), 10);
200-
const endMon = parseInt(dayjs(rangeFromTo.value.to).format('M'), 10);
199+
const beginMon = parseInt(dayjs(rangeFromTo.from).format('M'), 10);
200+
const endMon = parseInt(dayjs(rangeFromTo.to).format('M'), 10);
201201

202202
if (beginYear === endYear) {
203203
// 同一年内,禁用开始月份至结束月份之外的月份选项

0 commit comments

Comments
 (0)