var today = new Date();
var dateString = '2014-12-14';
var dateArray = dateString.split("-");
var dateObj = new Date(dateArray[0], Number(dateArray[1])-1, dateArray[2]);
dateObj.setFullYear(dateObj.getFullYear() + 2 ));
yy = dateObj.getFullYear();
mm = dateObj.getMonth() + 1; mm = (mm < 10) ? '0' + mm : mm;
dd = dateObj.getDate(); dd = (dd < 10) ? '0' + dd : dd;
$('#exchngTrgetDt').val(yy + '-' + mm + '-' + dd);
0 개의 댓글:
댓글 쓰기