Skip to content

Commit bdd7cdd

Browse files
authored
Merge pull request #1162 from alibaba/fix-disableDate
Fix disable date
2 parents ba8a3af + 7c8fbaa commit bdd7cdd

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

packages/form-render/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "form-render",
3-
"version": "1.14.15",
3+
"version": "1.14.16",
44
"description": "通过 JSON Schema 生成标准 Form,常用于自定义搭建配置界面生成",
55
"keywords": [
66
"Form",

packages/form-render/src/widgets/antd/dateRange.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,20 @@ const DateRange = ({ onChange, format, value, style, ...rest }) => {
6868
}
6969

7070
if (props.disabledDate && typeof props.disabledDate === 'string') {
71-
const func = methods[props.disabledDate];
71+
const func = methods?.[props.disabledDate];
7272
if (typeof func === 'function') {
7373
dateParams.disabledDate = func;
74+
} else {
75+
dateParams.disabledDate = undefined;
7476
}
7577
}
7678

7779
if (props.disabledTime && typeof props.disabledTime === 'string') {
78-
const func = methods[props.disabledTime];
80+
const func = methods?.[props.disabledTime];
7981
if (typeof func === 'function') {
8082
dateParams.disabledTime = func;
83+
} else {
84+
dateParams.disabledTime = undefined;
8185
}
8286
}
8387

0 commit comments

Comments
 (0)