handleClick() {
console.log(this.queryParams.updateTime);
if (
this.queryParams.updateTimeEnd === this.moment(this.end).format("YYYY-MM-DD") &&
this.queryParams.updateTime === this.moment(this.today).format("YYYY-MM-DD")
) {
this.queryParams.operateDate = "1";
}
else if (
this.queryParams.updateTimeEnd ===this.moment(this.end).format("YYYY-MM-DD") &&
this.queryParams.updateTime ===this.moment(this.weekTime).format("YYYY-MM-DD")
) {
this.queryParams.operateDate = "2";
}
else if (
this.queryParams.updateTimeEnd ===this.moment(this.end).format("YYYY-MM-DD") &&
this.queryParams.updateTime ===this.moment(this.monthTime).format("YYYY-MM-DD")
) {
this.queryParams.operateDate = "3";
}
else {
this.queryParams.operateDate = "";
}
theWeek() {
const start = new Date();
const nows = start.getDay() || 7; // 注意周日算第一天,如果周日查询本周的话,天数是0,所有如果是0,默认设置为7
start.setTime(start.getTime() - 3600 * 1000 * 24 * (nows - 1));
return start;
},
周和月都是个范围,你是要获取到那一周的第一天和那一个月的第一天么?
让我理解一下你的需求,你拿到的数据格式是yymmdd T16:00:00.000Z? 想要在js中拿到yymmdd 格式的?