export const selfTime =function(date){
  let myDate,myDay,myMonth,myYear,nextMonth,lastMonth,nextYear,lastYear,weekDate;
  let Date1 = new Date(date);
  myDay=Date1.getDate() .toString().padStart(2, "0");
   myYear=Date1.getFullYear() ;
   myMonth=(Date1.getMonth() + 1).toString().padStart(2, "0");
  if((Date1.getMonth() + 1)==12){
   nextMonth ='01';
   nextYear=Date1.getFullYear()+1
  }else{
    nextMonth =(Date1.getMonth() + 2).toString().padStart(2, "0");
    nextYear=Date1.getFullYear() ;
  }
  if((Date1.getMonth() + 1)==1){
    lastMonth='12';
    lastYear=Date1.getFullYear()-1
  }else{
    lastMonth=Date1.getMonth().toString().padStart(2, "0");
    lastYear=Date1.getFullYear() ;
  }
  myDate=`${myYear}-${myMonth}-${myDay}`;
  let Date2=new Date(date - 1000*60*60*24*7);//获取7天前的日期
  weekDate=`${Date2.getFullYear()}-${(Date2.getMonth() + 1).toString().padStart(2, "0")}-${Date2.getDate().toString().padStart(2, "0")}`;
  let dateObj={myYear,myMonth,myDay,myDate,lastMonth,lastYear,nextMonth,nextYear,weekDate}
  return dateObj
}
