ant-design/components/datepicker/demo/select.md
afc163 753c01ae18 ES6 syntax for demo code
fix antd.notification
2015-10-28 20:55:49 +08:00

458 B

选择日期

  • order: 2

通过设置选择日期的回调事件 onChange,完成交互行为。


import { Datepicker } from 'antd';

const Picker = React.createClass({
  handleChange: function(value) {
    console.log(new Date(value.getTime()));
  },
  render: function() {
    return <Datepicker onChange={this.handleChange} />
  }
});

ReactDOM.render(
  <Picker />
, document.getElementById('components-datepicker-demo-select'));