From 4793b6979ab60df83c6b0fed549aed2e4957fb23 Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 28 May 2015 14:53:23 +0800 Subject: [PATCH] datapicker demo --- components/datepicker/demo/formatter.md | 2 +- components/datepicker/demo/range.md | 2 +- components/datepicker/demo/select.md | 3 +-- components/datepicker/index.jsx | 8 ++++---- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/components/datepicker/demo/formatter.md b/components/datepicker/demo/formatter.md index 6feeba483d..d30edb5462 100644 --- a/components/datepicker/demo/formatter.md +++ b/components/datepicker/demo/formatter.md @@ -1,7 +1,7 @@ # 日期格式 - order: 1 -- description: 自定义您需要的日期定义格式:yyyy/MM/dd +- description: 使用 `format` 属性自定义您需要的日期定义格式:yyyy/MM/dd --- diff --git a/components/datepicker/demo/range.md b/components/datepicker/demo/range.md index 5efab0a875..2c9283107b 100644 --- a/components/datepicker/demo/range.md +++ b/components/datepicker/demo/range.md @@ -1,7 +1,7 @@ # 范围 - order: 3 -- description: 设置可选日期的范围 +- description: 设置可选日期的范围,用 disabled 方法来定义不可选择时间。 --- diff --git a/components/datepicker/demo/select.md b/components/datepicker/demo/select.md index 4de3c09931..1f0d268787 100644 --- a/components/datepicker/demo/select.md +++ b/components/datepicker/demo/select.md @@ -1,7 +1,7 @@ # 选择日期 - order: 2 -- description: 通过设置选择日期的回调事件,完成交互行为 +- description: 通过设置选择日期的回调事件 `onSelect`,完成交互行为。 --- @@ -21,4 +21,3 @@ React.render( , document.getElementById('components-datepicker-demo-select')); ```` - diff --git a/components/datepicker/index.jsx b/components/datepicker/index.jsx index a18c237a01..f7aad6209a 100644 --- a/components/datepicker/index.jsx +++ b/components/datepicker/index.jsx @@ -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 = ( } - 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}> );