import moment from 'moment'
export const timeShortcuts = [{
    text: '今天',
    value: () => timerange.today
  }, {
    text: '昨天',
    value: () => timerange.yestoday
  }, {
    text: '过去7天',
    value: () => timerange.last7days
  }, {
    text: '过去30天',
    value: () => timerange.last30days
  }, {
    text: '过去90天',
    value: () => timerange.last90days
  },
]

export const timerange = {
  today: [
    moment().format('YYYY-MM-DD 00:00:00'),
    moment().format('YYYY-MM-DD 23:59:59'),
  ],
  yestoday: [
    moment().add(-1, 'days').format('YYYY-MM-DD 00:00:00'),
    moment().add(-1, 'days').format('YYYY-MM-DD 23:59:59'),
  ],
  last7days: [
    moment().add(-7, 'days').format('YYYY-MM-DD 00:00:00'),
    moment().format('YYYY-MM-DD 23:59:59')
  ],last7daysMon: [
    moment().add(-7, 'days').format('YYYY-MM-DD'),
    moment().format('YYYY-MM-DD')
  ],
  last30days: [
    moment().add(-30, 'days').format('YYYY-MM-DD 00:00:00'),
    moment().format('YYYY-MM-DD 23:59:59'),
  ],
  last90days: [
    moment().add(-90, 'days').format('YYYY-MM-DD 00:00:00'),
    moment().format('YYYY-MM-DD 23:59:59'),
  ],
}
