function getDaysOfMonth(year, month) { month = parseInt(month); switch (month) { case 1: case 3: case 5: case 7: case 8: case 10: case 12: return 31; case 4: case 6: case 9: case 11: return 30; case 2: return ((year % 4 == 0 && year % 100 != 0) ||…
/** * 优惠券有效期 * startDate:起始日期 * valueTime:有效天数 */ function transferCouponValueTime(startDate,valueTime){ var date = new Date(startDate); var newDate = new Date(date.getFullYear(),date.getMonth(),date.getDate()+valueTime); var year1 = date.getFullYear…
方法1 /** * 获取某年月的天数 * @param year 年 * @param month 月(0-11) * @returns {number} 天数 */ var getDaysOfMonth = function (year, month) { month = month + 1; switch (month) { case 1: case 3: case 5: case 7: case 8: case 10: case 12: return 31; case 4: case 6:…