diff --git a/src/main/webapp/WEB-INF/views/homeEducationApplication/inquiry/homeEducationApplicationInquiry.jsp b/src/main/webapp/WEB-INF/views/homeEducationApplication/inquiry/homeEducationApplicationInquiry.jsp index b4f91e36..46c994a9 100644 --- a/src/main/webapp/WEB-INF/views/homeEducationApplication/inquiry/homeEducationApplicationInquiry.jsp +++ b/src/main/webapp/WEB-INF/views/homeEducationApplication/inquiry/homeEducationApplicationInquiry.jsp @@ -34,6 +34,52 @@ return year + '-' + month + '-' + day + '(' + dayOfWeek + ')'; } + function formatUnixTimestamp(unixTimestamp) { + const date = new Date(unixTimestamp); + + const year = date.getFullYear(); + const month = date.getMonth() + 1; // getMonth()는 0부터 시작하므로 1을 더합니다. + const day = date.getDate(); + let hours = date.getHours(); + const minutes = date.getMinutes(); + + let ampm = "오전"; + if (hours >= 12) { + ampm = "오후"; + hours = hours - 12; + } + if (hours === 0) { + hours = 12; // 자정은 12시로 표시 + } + + return year+"년 " + month +"월 " + day + "일 " + ampm + " " + hours + "시"; + } + + function unixTimestampToFormattedDateTime(unixTimestamp) { + const date = new Date(unixTimestamp); + + const year = date.getFullYear(); + const month = ('0' + (date.getMonth() + 1)).slice(-2); // 월은 0부터 시작하므로 1을 더하고, 두 자리로 만들기 위해 0을 앞에 붙인 후 마지막 두 자리만 취함 + const day = ('0' + date.getDate()).slice(-2); // 일도 두 자리로 만들기 위해 0을 앞에 붙인 후 마지막 두 자리만 취함 + + const daysOfWeek = ['일', '월', '화', '수', '목', '금', '토']; + const dayOfWeek = daysOfWeek[date.getDay()]; + + let hours = date.getHours(); + const minutes = date.getMinutes(); + + let ampm = "오전"; + if (hours >= 12) { + ampm = "오후"; + hours = hours - 12; + } + if (hours === 0) { + hours = 12; // 자정은 12시로 표시 + } + + return year+"년 " + month +"월 " + day + "일 " + '(' + dayOfWeek + ') ' + ampm + " " + hours + "시"; + } + function setDisplayEle(EleId, display) { var myEle = document.getElementById(EleId); if (myEle) { @@ -69,7 +115,41 @@ } - + let dataRegistryCompanyName = e.getAttribute('data-registry-company-name'); + if (dataRegistryCompanyName) { + var companyNameEle = document.getElementById('company-name'); + if (companyNameEle) { + companyNameEle.value = dataRegistryCompanyName; + } + } + let dataRegistryReqDept = e.getAttribute('data-registry-req-dept'); + if (dataRegistryReqDept) { + var reqDeptEle = document.getElementById('req-dept'); + if (reqDeptEle) { + reqDeptEle.value = dataRegistryReqDept; + } + } + let dataRegistryReqName = e.getAttribute('data-registry-req-name'); + if (dataRegistryReqName) { + var reqNameEle = document.getElementById('req-name'); + if (reqNameEle) { + reqNameEle.value = dataRegistryReqName; + } + } + let dataRegistryReqTel = e.getAttribute('data-registry-req-tel'); + if (dataRegistryReqTel) { + var reqTelEle = document.getElementById('req-tel'); + if (reqTelEle) { + reqTelEle.value = dataRegistryReqTel; + } + } + let dataRegistryReqEmail = e.getAttribute('data-registry-req-email'); + if (dataRegistryReqEmail) { + var reqEmailEle = document.getElementById('req-email'); + if (reqEmailEle) { + reqEmailEle.value = dataRegistryReqEmail; + } + } let dataRegistryReqPosition = e.getAttribute('data-registry-req-position'); if (dataRegistryReqPosition) { var reqPositionEle = document.getElementById('req-position'); @@ -77,15 +157,6 @@ reqPositionEle.value = dataRegistryReqPosition; } } - /* - - item.put("registryCompanyName - item.put("registryReqDept - item.put("registryReqName - item.put("registryReqTel - item.put("registryReqEmail - */ - var whtRegIdEle = document.getElementById('wht-reg-id'); if (whtRegIdEle) { @@ -106,7 +177,13 @@ return ''; } else if( item.stateCode === 'T' ) { // 이미 신청이 완료된 교육 - return '수정'; + return '수정'; } else if( item.stateCode === 'D' ) { // 삭제된 교육 return ''; @@ -126,6 +203,7 @@ const homeVisitListEle = document.getElementById('home-visit-list'); let homeVisitListHTML = ''; + let validCnt = 0; for( idx in data ) { if( data[idx].stateCode === 'D' ) { @@ -134,16 +212,17 @@ homeVisitListHTML += `