/**
 * imui.Datepicker - WeekTh
 * @author riverhan
 * @data 2016-8-10
 */

import React from 'react';
import classnames from 'classnames';

const weekMap = ['日', '一', '二', '三', '四', '五', '六'];
const weekendStr = '06';

const renderThList = function () {
  return [0, 1, 2, 3, 4, 5, 6]
    .map(index => {
      const thStr = weekMap[index];
      const isWeekend = weekendStr.indexOf(index) >= 0;

      return (
        <span
          className={classnames({
            'im-dp-wt': true,
            'im-dp-wt--weekend': isWeekend
          })}
          key={index}
        >{thStr}</span>
      );
    });
};

const WeekTh = function () {
  return (
    <div
      className="im-dp-wtlist"
    >
      {renderThList()}
    </div>
  );
};

export default WeekTh;
