Skip to content

Commit d234cba

Browse files
authored
fix:时间段禁用在同一年内年份不可选 (#3307)
1 parent 50106dc commit d234cba

File tree

1 file changed

+5
-1
lines changed
  • packages/renderless/src/year-table

1 file changed

+5
-1
lines changed

packages/renderless/src/year-table/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,12 @@ export const getIsDefault =
2626
export const getIsDisabled =
2727
({ props }) =>
2828
(year) => {
29+
const MONTHS = Array.from({length: 12}, (_, i) => i);
30+
2931
return typeof props.disabledDate === 'function'
30-
? props.disabledDate(new Date(year, 0, 1, 0))
32+
? MONTHS.every(month =>
33+
props.disabledDate(new Date(year, month, 1))
34+
)
3135
: false
3236
}
3337

0 commit comments

Comments
 (0)