datapicker demo

This commit is contained in:
afc163 2015-05-28 14:53:23 +08:00
parent a2570196e6
commit 4793b6979a
4 changed files with 7 additions and 8 deletions

View File

@ -1,7 +1,7 @@
# 日期格式
- order: 1
- description: 自定义您需要的日期定义格式yyyy/MM/dd
- description: 使用 `format` 属性自定义您需要的日期定义格式yyyy/MM/dd
---

View File

@ -1,7 +1,7 @@
# 范围
- order: 3
- description: 设置可选日期的范围
- description: 设置可选日期的范围,用 disabled 方法来定义不可选择时间。
---

View File

@ -1,7 +1,7 @@
# 选择日期
- order: 2
- description: 通过设置选择日期的回调事件,完成交互行为
- description: 通过设置选择日期的回调事件 `onSelect`,完成交互行为
---
@ -21,4 +21,3 @@ React.render(
<Picker />
, document.getElementById('components-datepicker-demo-select'));
````

View File

@ -32,8 +32,6 @@ module.exports = React.createClass({
this.props.onSelect(new Date(this.state.value.getTime()));
},
render: function () {
var state = this.state;
var formatter = new DateTimeFormat(this.props.format);
var calendar = (
<Calendar
locale={CalendarLocale}
@ -43,8 +41,10 @@ module.exports = React.createClass({
return (
<DatePicker
trigger={<span className="rc-calendar-picker-icon" />}
formatter={formatter} calendar={calendar}
value={this.state.value} onChange={this.props.onSelect}>
calendar={calendar}
formatter={new DateTimeFormat(this.props.format)}
value={this.state.value}
onChange={this.props.onSelect}>
<input className="rc-calendar-picker-input" />
</DatePicker>
);