mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-28 13:09:40 +08:00
fix bug in getting-started - date is null when clear the DatePick (#10111)
This commit is contained in:
parent
ee4f788ae0
commit
ad721111a4
4
docs/react/getting-started.en-US.md
Normal file → Executable file
4
docs/react/getting-started.en-US.md
Normal file → Executable file
@ -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
Normal file → Executable file
4
docs/react/getting-started.zh-CN.md
Normal file → Executable file
@ -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…
Reference in New Issue
Block a user