const date = new Date()
const dateObj = {
  year: date.getFullYear(),
  month: date.getMonth() + 1 > 9 ? date.getMonth() + 1 : `0${date.getMonth() + 1}`,
  day: date.getDate() > 9 ? date.getDate() : `0${date.getDate()}`
}
module.exports = {
  all: {
    view: '全部',
    startDate: '', // 给datePicker用的
    endDate: '',
    dStart: '', // 给接口用的
    dEnd: ''
  },
  oneMonth: {
    view: dateObj.month == 1 ? `${dateObj.year - 1}-12-${dateObj.day + 1} - ${dateObj.year}-01-${dateObj.day}` : `${dateObj.year}-0${dateObj.month - 1}-${dateObj.day} - ${dateObj.year}-${dateObj.month}-${dateObj.day}`,
    // eslint-disable-next-line
    startDate: moment().subtract(30, 'days'),
    // eslint-disable-next-line
    endDate: moment().subtract(0, 'days'),
    dStart: dateObj.month == 1 ? `${dateObj.year - 1}12${dateObj.day + 1}000000` : `${dateObj.year}0${dateObj.month - 1}${dateObj.day}000000`,
    dEnd: `${dateObj.year}${dateObj.month}${dateObj.day}000000`
  }
}
