有问题的邮件联系我 785428657@qq.com
function getPreMonthDate() {
let times = new Date();
let Y = times.getFullYear();
let M = times.getMonth();
let dateArr = [];
if (M == 1 || M == 3 || M == 5 || M == 7 || M == 8 || M == 10 || M == 12) {
for (let i = 1; i <= 31; i++) {
dateArr[i-1] = M + "/" + i;
}
} else if (M == 4 || M == 6 || M == 9 || M == 11) {
for (let i = 1; i <= 30; i++) {
dateArr[i-1] = M + "/" + i;
}
} else {
if (((Y % 4) == 0) && ((Y % 100) != 0) || ((Y % 400) == 0)) { //闰年