DateTimePickerHours.js
3.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
import React, { Component, PropTypes } from "react";
import Constants from "./Constants.js";
import cx from "classnames";
import s from "./DateTimePicker.scss";
export default class DateTimePickerHours extends Component {
static propTypes = {
setSelectedHour: PropTypes.func.isRequired,
onSwitch: PropTypes.func.isRequired,
mode: PropTypes.string.isRequired
}
renderSwitchButton = () => {
return this.props.mode === Constants.MODE_TIME ?
(
<ul className="list-unstyled">
<li>
<span className="btn picker-switch" onClick={this.props.onSwitch} style={{width: "100%"}} ><span className="glyphicon glyphicon-time" /></span>
</li>
</ul>
) :
null;
}
render() {
return (
<div className={cx(s.timepicker_hours,'timepicker-hours')} data-action="selectHour" style={{display: "block"}}>
{/*this.renderSwitchButton()*/}
<table className="table-condensed">
<tbody>
<tr>
<td className={cx(s.hour,'hour')} onClick={this.props.setSelectedHour}>01</td>
<td className={cx(s.hour,'hour')} onClick={this.props.setSelectedHour}>02</td>
<td className={cx(s.hour,'hour')} onClick={this.props.setSelectedHour}>03</td>
<td className={cx(s.hour,'hour')} onClick={this.props.setSelectedHour}>04</td>
</tr>
<tr>
<td className={cx(s.hour,'hour')} onClick={this.props.setSelectedHour}>05</td>
<td className={cx(s.hour,'hour')} onClick={this.props.setSelectedHour}>06</td>
<td className={cx(s.hour,'hour')} onClick={this.props.setSelectedHour}>07</td>
<td className={cx(s.hour,'hour')} onClick={this.props.setSelectedHour}>08</td>
</tr>
<tr>
<td className={cx(s.hour,'hour')} onClick={this.props.setSelectedHour}>09</td>
<td className={cx(s.hour,'hour')} onClick={this.props.setSelectedHour}>10</td>
<td className={cx(s.hour,'hour')} onClick={this.props.setSelectedHour}>11</td>
<td className={cx(s.hour,'hour')} onClick={this.props.setSelectedHour}>12</td>
</tr>
<tr>
<td className={cx(s.hour,'hour')} onClick={this.props.setSelectedHour}>13</td>
<td className={cx(s.hour,'hour')} onClick={this.props.setSelectedHour}>14</td>
<td className={cx(s.hour,'hour')} onClick={this.props.setSelectedHour}>15</td>
<td className={cx(s.hour,'hour')} onClick={this.props.setSelectedHour}>16</td>
</tr>
<tr>
<td className={cx(s.hour,'hour')} onClick={this.props.setSelectedHour}>17</td>
<td className={cx(s.hour,'hour')} onClick={this.props.setSelectedHour}>18</td>
<td className={cx(s.hour,'hour')} onClick={this.props.setSelectedHour}>19</td>
<td className={cx(s.hour,'hour')} onClick={this.props.setSelectedHour}>20</td>
</tr>
<tr>
<td className={cx(s.hour,'hour')} onClick={this.props.setSelectedHour}>21</td>
<td className={cx(s.hour,'hour')} onClick={this.props.setSelectedHour}>22</td>
<td className={cx(s.hour,'hour')} onClick={this.props.setSelectedHour}>23</td>
<td className={cx(s.hour,'hour')} onClick={this.props.setSelectedHour}>24</td>
</tr>
</tbody>
</table>
</div>
);
}
}