반응형 반응형 자바스크립트한달전1 반응형 자바스크립트 한달 전 //날짜 초기화 function init(){ let now = new Date(); let end_dt = now.toLocaleDateString().replace(/ /gi, ''); var oneMonthAgo = new Date(now.setMonth(now.getMonth() - 1)); // 한달 전 let start_dt = oneMonthAgo.toLocaleDateString().replace(/ /gi, ''); //옛날에 이렇게 했는데... 고쳤다 /* let year = now.getFullYear(); // 년도 let month = now.getMonth() + 1; // 월 let last_month = now.getMonth(); let date = now.getDate().. 2020. 12. 31. 이전 1 다음 반응형