export function getDate(day: Date,isSmaller:Boolean) {
  let mm:Number,dd:Number
  if(isSmaller){
    mm = day.getMonth() + 1 < 10 ?  + (day.getMonth()+1): day.getMonth()+1 ;
    dd = day.getDate() < 10 ?  + (day.getDate()+1) : day.getDate()+1;
  } else {
    mm = day.getMonth() + 1 < 10 ?  + day.getMonth(): day.getMonth() ;
    dd = day.getDate() < 10 ?  + day.getDate() : day.getDate();
  }
  return mm + "/" + dd
}

 export function getPastDaysUtilYesterday(total: number):Array<String> {
  const isSmaller = total < new Date().getDate() ? true:false
  let period: Array<string> = [];
  const startDay = new Date();
  startDay.setDate(startDay.getDate()-total-1);
  for (let i = 0; i < total; i++) {
    let day = new Date();
    day.setDate(startDay.getDate() + i);
    period.push(getDate(day,isSmaller))
  }
  return period
}

