var getCurrentWeek = function (day) { var days = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"]; //定义数组 var week = []; //获取当前星期X(0-6,0代表星期天) var index = new Date(day).getDay(); //循环 for (va…
1.获取某月第一天和最后一天日期 function getDateByMonth (timeStamp) { let inDate = new Date(timeStamp) let year = inDate.getFullYear() let month = inDate.getMonth() let startTime = new Date(year, month, 1).getTime() let endTime = new Date(year, month + 1, 0).getTim…