import React from 'react';
import { getTimeRange, getRange } from '../index';

const Demo = () => {
  return (
    <div>
      <h2>getTimeRange(type)：</h2>
      <div>
        <b>全部：</b> {JSON.stringify(getTimeRange())}
      </div>
      <div>
        <b>今年-thisYear：</b> {JSON.stringify(getTimeRange('thisYear'))}
      </div>
      <div>
        <b>去年-lastYear：</b> {JSON.stringify(getTimeRange('lastYear'))}
      </div>
      <div>
        <b>明年-nextYear：</b> {JSON.stringify(getTimeRange('nextYear'))}
      </div>
      <div>
        <b>上季度-lastQuarter：</b> {JSON.stringify(getTimeRange('lastQuarter'))}
      </div>
      <div>
        <b>本季度-thisQuarter：</b> {JSON.stringify(getTimeRange('thisQuarter'))}
      </div>
      <div>
        <b>下季度-nextQuarter：</b> {JSON.stringify(getTimeRange('nextQuarter'))}
      </div>
      <div>
        <b>上月-lastMonth：</b> {JSON.stringify(getTimeRange('lastMonth'))}
      </div>
      <div>
        <b>本月-thisMonth：</b> {JSON.stringify(getTimeRange('thisMonth'))}
      </div>
      <div>
        <b>下月-nextMonth：</b> {JSON.stringify(getTimeRange('nextMonth'))}
      </div>
      <div>
        <b>上周-lastWeek：</b> {JSON.stringify(getTimeRange('lastWeek'))}
      </div>
      <div>
        <b>本周-thisWeek：</b> {JSON.stringify(getTimeRange('thisWeek'))}
      </div>
      <div>
        <b>下周-nextWeek：</b> {JSON.stringify(getTimeRange('nextWeek'))}
      </div>
      <div>
        <b>昨天-lastDay：</b> {JSON.stringify(getTimeRange('lastDay'))}
      </div>
      <div>
        <b>今天-thisDay：</b> {JSON.stringify(getTimeRange('thisDay'))}
      </div>
      <div>
        <b>明天-nextDay：</b> {JSON.stringify(getTimeRange('nextDay'))}
      </div>
      <br />
      <h2>getRange(date, type)：</h2>
      <div>
        <b>type：</b> {JSON.stringify(getRange())}
      </div>
      <div>
        <b>type-day：</b> {JSON.stringify(getRange(new Date(), 'day'))}
      </div>
      <div>
        <b>type-week：</b> {JSON.stringify(getRange(new Date(), 'week'))}
      </div>
      <div>
        <b>type-month：</b> {JSON.stringify(getRange(new Date(), 'month'))}
      </div>
      <div>
        <b>type-year：</b> {JSON.stringify(getRange(new Date(), 'year'))}
      </div>
    </div>
  );
};

export default Demo;
