JS获取指定年月天数

function getMonthDays(year, month) {
            var tmpList = [];
            var endDay = new Date(year, month, 0).getDate();
            for (var i = 1; i <= endDay; i++) {
                tmpList.push(i < 10 ? "0" + i : i.toString())
            }
            return tmpList;
        }

你可能感兴趣的:(JS获取指定年月天数)