1 | import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
|
2 | import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
|
3 | import _inherits from 'babel-runtime/helpers/inherits';
|
4 | import React, { PureComponent } from 'react';
|
5 | import { DAYS_OF_WEEK } from '../utils';
|
6 |
|
7 | var DateTableHead = function (_PureComponent) {
|
8 | _inherits(DateTableHead, _PureComponent);
|
9 |
|
10 | function DateTableHead() {
|
11 | _classCallCheck(this, DateTableHead);
|
12 |
|
13 | return _possibleConstructorReturn(this, _PureComponent.apply(this, arguments));
|
14 | }
|
15 |
|
16 | DateTableHead.prototype.render = function render() {
|
17 | var _props = this.props,
|
18 | prefix = _props.prefix,
|
19 | momentLocale = _props.momentLocale;
|
20 |
|
21 | var firstDayOfWeek = momentLocale.firstDayOfWeek();
|
22 | var weekdaysShort = momentLocale.weekdaysShort();
|
23 |
|
24 | var elements = [];
|
25 | for (var i = 0; i < DAYS_OF_WEEK; i++) {
|
26 | var index = (firstDayOfWeek + i) % DAYS_OF_WEEK;
|
27 | elements.push(React.createElement(
|
28 | 'th',
|
29 | { key: i, className: prefix + 'calendar-th', role: 'cell' },
|
30 | weekdaysShort[index]
|
31 | ));
|
32 | }
|
33 |
|
34 | return React.createElement(
|
35 | 'thead',
|
36 | { className: prefix + 'calendar-thead', role: 'rowgroup' },
|
37 | React.createElement(
|
38 | 'tr',
|
39 | { role: 'row' },
|
40 | elements
|
41 | )
|
42 | );
|
43 | };
|
44 |
|
45 | return DateTableHead;
|
46 | }(PureComponent);
|
47 |
|
48 | export default DateTableHead; |
\ | No newline at end of file |