JavaScript 날짜 더하기/빼기 add_date 함수 소스
JavaScript 날짜 더하기/빼기 add_date 함수 소스 function add_date(sDate, nDays) { var yy = parseInt(sDate.substr(0, 4), 10); var mm = parseInt(sDate.substr(5, 2), 10); var dd = parseInt(sDate.substr(8), 10); d = new Date(yy, mm - 1, dd + nDays); yy = d.getFullYear(); mm = d.getMonth() + 1; mm = (mm < 10) ? '0' + mm : mm; dd = d.getDate(); dd = (dd < 10) ? '0' + dd : dd; return "" + yy + "-" + mm + "-" + dd;}