[javaScript] 날짜 일자 차이 / 개월수 차이 구하기


[javaScript] 날짜 일자 차이 / 개월수 차이 구하기

일자 차이 구하기 - 문제 : 2월의 경우 데이터 정확성 떨어짐 //날짜 최대 31일 세팅 const start_date_arr = startDate.split("-"); const end_date_arr = endDate.split("-"); const s_date = new Date(start_date_arr[0],start_date_arr[1],start_date_arr[2]); const e_date = new Date(end_date_arr[0],end_date_arr[1],end_date_arr[2]); const btMs = e_date.getTime() - s_date.getTime() ; const btDay = btMs / (1000*60*60*24) ; //일수차이 문제: 2월의 경..


원문링크 : [javaScript] 날짜 일자 차이 / 개월수 차이 구하기