/** * 优惠券有效期 * 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(); var month1 = date.getMonth()+1; var day1 = date.getDate(); var year2 = newDate.getFullYear(); var month2 = newDate.getMonth()+1; var day2 = newDate.getDate(); return ""+year1+"-"+month1+"-"+day1+"一" +year2+"-"+month2+"-"+day2+""; }