Browse Source

default value of datepicker

pull/4/head
afc163 10 years ago
parent
commit
03e59b7a77
  1. 7
      components/datepicker/index.jsx

7
components/datepicker/index.jsx

@ -20,6 +20,13 @@ module.exports = React.createClass({
format: 'yyyy-MM-dd' format: 'yyyy-MM-dd'
}; };
}, },
componentDidMount: function () {
if (this.props.value) {
var value = new GregorianCalendar(zhCn);
value.setTime(new Date(this.props.value));
this.setState({value: value});
}
},
render: function () { render: function () {
var state = this.state; var state = this.state;
var formatter = new DateTimeFormat(this.props.format); var formatter = new DateTimeFormat(this.props.format);

Loading…
Cancel
Save