()
| 104 | } |
| 105 | |
| 106 | open () { |
| 107 | if (this.props.readOnly || this.state.active) { |
| 108 | return; |
| 109 | } |
| 110 | |
| 111 | let today = new Date(); |
| 112 | // remove time |
| 113 | today = new Date(today.getFullYear(), today.getMonth(), today.getDate()); |
| 114 | |
| 115 | let picker = this.refs.datepicker; |
| 116 | picker.style.display = 'block'; |
| 117 | let height = getOuterHeight(picker); |
| 118 | |
| 119 | setTimeout(() => { |
| 120 | this.setState({ |
| 121 | active: true, |
| 122 | popup: overView(this.refs.datetime, height), |
| 123 | current: this.state.value || today, |
| 124 | stage: this.props.type === TIME ? 'clock' : 'day' |
| 125 | }); |
| 126 | |
| 127 | this.bindClickAway(); |
| 128 | |
| 129 | if (this.props.type === TIME) { |
| 130 | this.refs.clock.changeTimeStage('hour'); |
| 131 | } |
| 132 | }, 0); |
| 133 | } |
| 134 | |
| 135 | close () { |
| 136 | this.setState({ active: false }); |
no test coverage detected