mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 02:59:58 +08:00
datapicker demo
This commit is contained in:
parent
a2570196e6
commit
4793b6979a
@ -1,7 +1,7 @@
|
||||
# 日期格式
|
||||
|
||||
- order: 1
|
||||
- description: 自定义您需要的日期定义格式:yyyy/MM/dd
|
||||
- description: 使用 `format` 属性自定义您需要的日期定义格式:yyyy/MM/dd
|
||||
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
# 范围
|
||||
|
||||
- order: 3
|
||||
- description: 设置可选日期的范围
|
||||
- description: 设置可选日期的范围,用 disabled 方法来定义不可选择时间。
|
||||
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
# 选择日期
|
||||
|
||||
- order: 2
|
||||
- description: 通过设置选择日期的回调事件,完成交互行为
|
||||
- description: 通过设置选择日期的回调事件 `onSelect`,完成交互行为。
|
||||
|
||||
---
|
||||
|
||||
@ -21,4 +21,3 @@ React.render(
|
||||
<Picker />
|
||||
, document.getElementById('components-datepicker-demo-select'));
|
||||
````
|
||||
|
||||
|
@ -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>
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user