Browse Source

fix time-picker demo error in safari

pull/929/head
afc163 9 years ago
parent
commit
d064e122b3
  1. 4
      components/time-picker/demo/basic.md
  2. 8
      components/time-picker/demo/value.md

4
components/time-picker/demo/basic.md

@ -10,9 +10,7 @@
import { TimePicker } from 'antd';
function onChange(time) {
if (time) {
console.log(time.toLocaleTimeString('zh-CN', { hour12: false }));
}
console.log(time);
}
ReactDOM.render(

8
components/time-picker/demo/value.md

@ -16,12 +16,8 @@ const Test = React.createClass({
};
},
onChange(time) {
const parsedTime = time && time.toLocaleTimeString('zh-CN', {
hour12: false
});
console.log(time, parsedTime);
this.setState({ value: parsedTime });
// or this.setState({ value: time });
console.log(time);
this.setState({ value: time });
},
render() {
return <TimePicker value={this.state.value} onChange={this.onChange} />;

Loading…
Cancel
Save