From 26a3feaccae691aa239bf4e742daf066723b5307 Mon Sep 17 00:00:00 2001 From: zollero Date: Tue, 3 Apr 2018 15:44:39 +0800 Subject: [PATCH 1/2] Add attribute: disabledDateInput to set the disabled of DateInput component. And add it to the example file. --- examples/antd-calendar.js | 18 ++++++++++++++++++ src/Calendar.jsx | 4 +++- src/range-calendar/CalendarPart.js | 3 +++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/examples/antd-calendar.js b/examples/antd-calendar.js index 950e5c327..d929c65e3 100644 --- a/examples/antd-calendar.js +++ b/examples/antd-calendar.js @@ -78,6 +78,7 @@ class Demo extends React.Component { showDateInput: true, disabled: false, value: props.defaultValue, + disableDateInput: false, }; } @@ -106,6 +107,12 @@ class Demo extends React.Component { }); } + toggleDisableDateInput = () => { + this.setState({ + disableDateInput: !this.state.disableDateInput, + }); + } + render() { const state = this.state; const calendar = ( disabled +
+
Date: Tue, 3 Apr 2018 15:54:13 +0800 Subject: [PATCH 2/2] add attribute: disableDateInput into the RADME --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 3a4172d9b..0e059fe72 100644 --- a/README.md +++ b/README.md @@ -218,6 +218,12 @@ http://react-component.github.io/calendar/examples/index.html date input's placeholder + + disableDateInput + Boolean + false + disable range date input + mode enum('time', 'date', 'month', 'year', 'decade') @@ -366,6 +372,12 @@ http://react-component.github.io/calendar/examples/index.html range date input's placeholders + + disableDateInput + Boolean + false + disable range date input + disabledTime Function(current: moment[], type:'start'|'end'):Object