Commit 11265599 by shaojiawen

update:时间设置

parent e79f7c5f
......@@ -80,21 +80,23 @@ export default {
// 近三个月
setDate = endDate => {
endDate.setMonth(endDate.getMonth() - 3);
endDate.setDate(endDate.getDate() + 1);
endDate.setDate(1);
return new Date(endDate);
};
} else if (index == 3) {
// 近半年
setDate = endDate => {
endDate.setMonth(endDate.getMonth() - 6);
endDate.setDate(endDate.getDate() + 1);
endDate.setDate(1); // 以1号为开端
// endDate.setDate(endDate.getDate() + 1);
return new Date(endDate);
};
} else {
// 近一年
setDate = endDate => {
endDate.setFullYear(endDate.getFullYear() - 1);
endDate.setDate(endDate.getDate() + 1);
endDate.setDate(1);
// endDate.setDate(endDate.getDate() + 1);
return new Date(endDate);
};
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment