{"size": 2563, "ext": "js", "max_stars_repo_path": "node_modules/rc-calendar/es/date/DateTHead.js", "max_stars_repo_name": "fernandofirm/smallworld-master", "max_stars_repo_stars_event_min_datetime": "2017-07-18T06:50:11.000Z", "max_stars_repo_stars_event_max_datetime": "2017-07-18T06:50:18.000Z", "max_issues_repo_path": "node_modules/rc-calendar/es/date/DateTHead.js", "max_issues_repo_name": "zyzlouis/ERC20Airdrop", "max_issues_repo_issues_event_min_datetime": "2018-03-29T07:52:02.000Z", "max_issues_repo_issues_event_max_datetime": "2018-03-29T07:52:02.000Z", "max_forks_repo_path": "node_modules/rc-calendar/es/date/DateTHead.js", "max_forks_repo_name": "zyzlouis/ERC20Airdrop", "max_forks_repo_forks_event_min_datetime": "2019-07-25T10:00:57.000Z", "max_forks_repo_forks_event_max_datetime": "2020-02-16T05:21:55.000Z"}
{"max_stars_count": 3, "max_issues_count": 1, "max_forks_count": 2, "avg_line_length": 30.8795180723, "max_line_length": 126, "alphanum_fraction": 0.6047600468}
import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
import _createClass from 'babel-runtime/helpers/createClass';
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
import _inherits from 'babel-runtime/helpers/inherits';
import React from 'react';
import DateConstants from './DateConstants';
import moment from 'moment';

var DateTHead = function (_React$Component) {
  _inherits(DateTHead, _React$Component);

  function DateTHead() {
    _classCallCheck(this, DateTHead);

    return _possibleConstructorReturn(this, (DateTHead.__proto__ || Object.getPrototypeOf(DateTHead)).apply(this, arguments));
  }

  _createClass(DateTHead, [{
    key: 'render',
    value: function render() {
      var props = this.props;
      var value = props.value;
      var localeData = value.localeData();
      var prefixCls = props.prefixCls;
      var veryShortWeekdays = [];
      var weekDays = [];
      var firstDayOfWeek = localeData.firstDayOfWeek();
      var showWeekNumberEl = void 0;
      var now = moment();
      for (var dateColIndex = 0; dateColIndex < DateConstants.DATE_COL_COUNT; dateColIndex++) {
        var index = (firstDayOfWeek + dateColIndex) % DateConstants.DATE_COL_COUNT;
        now.day(index);
        veryShortWeekdays[dateColIndex] = localeData.weekdaysMin(now);
        weekDays[dateColIndex] = localeData.weekdaysShort(now);
      }

      if (props.showWeekNumber) {
        showWeekNumberEl = React.createElement(
          'th',
          {
            role: 'columnheader',
            className: prefixCls + '-column-header ' + prefixCls + '-week-number-header'
          },
          React.createElement(
            'span',
            { className: prefixCls + '-column-header-inner' },
            'x'
          )
        );
      }
      var weekDaysEls = weekDays.map(function (day, xindex) {
        return React.createElement(
          'th',
          {
            key: xindex,
            role: 'columnheader',
            title: day,
            className: prefixCls + '-column-header'
          },
          React.createElement(
            'span',
            { className: prefixCls + '-column-header-inner' },
            veryShortWeekdays[xindex]
          )
        );
      });
      return React.createElement(
        'thead',
        null,
        React.createElement(
          'tr',
          { role: 'row' },
          showWeekNumberEl,
          weekDaysEls
        )
      );
    }
  }]);

  return DateTHead;
}(React.Component);

export default DateTHead;