获取某天日期
getSomeDay(someDay) {
let currentDate = new Date();
let targetday_milliseconds = currentDate.getTime() + 1000 * 60 * 60 * 24 * someDay;
currentDate.setTime(targetday_milliseconds);
const doHandleMonth = (month) => {
let m = month;
if (month.toString().length == 1) {
m = `0${month}`
}
return m
}
let year = currentDate.getFullYear();
let month = currentDate.getMonth();
let date = currentDate.getDate();
let day = currentDate.getDay();
let time = parseInt(currentDate.getTime() / 1000);
month = doHandleMonth(month + 1);
date = doHandleMonth(date);
const week = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']
return {
't': time,
'y': year,
'm': month,
'd': date,
'w': week[day]
};
}