getMonthLastDay() {
getCurrentTime().then(({ data })=>{
let today = data
today = new Date(today);
const month = today.getMonth() + 1;
let year = today.getFullYear();
let lastDay = {};
if (month >= 1 && month <= 3) {
lastDay.first = this.getLastDay( year-1 , 3)
lastDay.sec = this.getLastDay( year-1 , 6)
lastDay.thi = this.getLastDay( year-1 , 9)
lastDay.for = this.getLastDay( year-1 , 12)
} else if (month >= 4 && month <= 6) {
lastDay.first = this.getLastDay( year-1 , 6)
lastDay.sec = this.getLastDay( year-1 , 9)
lastDay.thi = this.getLastDay( year-1 , 12)
lastDay.for = this.getLastDay( year , 3)
} else if (month >= 7 && month <= 9) {
lastDay.first = this.getLastDay( year-1 , 9)
lastDay.sec = this.getLastDay( year-1 , 12)
lastDay.thi = this.getLastDay( year , 3)
lastDay.for = this.getLastDay( year , 6)
} else {
lastDay.first = this.getLastDay( year-1 , 12)
lastDay.sec = this.getLastDay( year , 3)
lastDay.thi = this.getLastDay( year , 6)
lastDay.for = this.getLastDay( year , 9)
}
this.lastDay = Object.values(lastDay);
});
},
getLastDay(y,m){
let dt = new Date(y,m,1);
dt = new Date(dt.getTime()-1000*60*60*24);
return dt.getFullYear().toString() + "-" + (dt.getMonth()+1).toString() + "-" + dt.getDate().toString()
}