From ca837c7ecf746cf2b24f0f358699c320fcac7e89 Mon Sep 17 00:00:00 2001 From: thkim Date: Fri, 1 Nov 2024 15:56:43 +0900 Subject: [PATCH] . --- .../homeEducationApplicationInquiry.jsp | 168 ++++++++++-------- src/main/webapp/web/preview/HOLE.reb | Bin 576538 -> 577082 bytes 2 files changed, 94 insertions(+), 74 deletions(-) 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 += ` - ` + data[idx].whtRegId + ` + ` + (validCnt+1) + ` ` + data[idx].trainingName + ` - ` + unixTimestampToFormattedDate(data[idx].trainingDatetime) + ` + ` + unixTimestampToFormattedDateTime(data[idx].trainingDatetime) + ` ` + data[idx].trainingLocation + ` ` + unixTimestampToFormattedDate(data[idx].regStartDate) + `~` + unixTimestampToFormattedDate(data[idx].regEndDate) + ` ` + getButtonHTML(data[idx]) + ` `; + validCnt ++; } - if( data.length === 0 ) { + if( validCnt === 0 ) { homeVisitListHTML = ` @@ -407,7 +486,7 @@ } - document.addEventListener('DOMContentLoaded', function () { + document.addEventListener('DOMContentLoaded', function () { init(); }); @@ -439,67 +518,8 @@ - - diff --git a/src/main/webapp/web/preview/HOLE.reb b/src/main/webapp/web/preview/HOLE.reb index 0424c4ceeb666610b9f096ba9265173832cce973..d558ee207093f68b9e3393ea5e7e0d5b70b94153 100644 GIT binary patch delta 561 zcmbO=LwVO6<%SlJ!AWxMCO^yxFl2NGA(6hlmO{uW8VH@F^GrV z9M-hMj0{Lp0n;B$V3wL55X@Y-eeQmy*lCP02>TTj5XzLU!x+2Wu97*8 zdwRh_CWYx6rZ5XnH~7JxvArgVc_uS1$t81{mNGMngLFP)+8(e3#KUe5YuaH(1|%tg zX_J_xrhf=#F5GT=fGKtwV>HMRH*O4@F~#}LvAeNjst4NuR&B6y`^}&1amMWnE--IjaDheQAr9x__cp`@NWMV|Fx(!U4)o~rcCL4<+qvGcsUM-E M&7dHLgo4i<0Abw20RR91