Browse Source

fix bug in getting-started - date is null when clear the DatePick (#10111)

pull/10128/head
Open Next 7 years ago
committed by Wei Zhu
parent
commit
ad721111a4
  1. 4
      docs/react/getting-started.en-US.md
  2. 4
      docs/react/getting-started.zh-CN.md

4
docs/react/getting-started.en-US.md

@ -79,7 +79,7 @@ class App extends React.Component {
};
}
handleChange(date) {
message.info('Selected Date: ' + date.toString());
message.info('Selected Date: ' + (date ? date.toString() : ''));
this.setState({ date });
}
render() {
@ -87,7 +87,7 @@ class App extends React.Component {
<LocaleProvider locale={frFR}>
<div style={{ width: 400, margin: '100px auto' }}>
<DatePicker onChange={value => this.handleChange(value)} />
<div style={{ marginTop: 20 }}>Date: {this.state.date.toString()}</div>
<div style={{ marginTop: 20 }}>Date: {this.state.date && this.state.date.toString()}</div>
</div>
</LocaleProvider>
);

4
docs/react/getting-started.zh-CN.md

@ -81,7 +81,7 @@ class App extends React.Component {
};
}
handleChange(date) {
message.info('您选择的日期是: ' + date.toString());
message.info('您选择的日期是: ' + (date ? date.toString() : ''));
this.setState({ date });
}
render() {
@ -89,7 +89,7 @@ class App extends React.Component {
<LocaleProvider locale={zhCN}>
<div style={{ width: 400, margin: '100px auto' }}>
<DatePicker onChange={value => this.handleChange(value)} />
<div style={{ marginTop: 20 }}>当前日期:{this.state.date.toString()}</div>
<div style={{ marginTop: 20 }}>当前日期:{this.state.date && this.state.date.toString()}</div>
</div>
</LocaleProvider>
);

Loading…
Cancel
Save