From b567dedcaa5ff1a7bf52a7cf80e6dfd08d924769 Mon Sep 17 00:00:00 2001 From: leeheejin Date: Thu, 13 Nov 2025 13:56:10 +0900 Subject: [PATCH] =?UTF-8?q?=EB=82=A0=EC=A7=9C=EC=88=98=EC=A0=95=20?= =?UTF-8?q?=EC=9E=98=20=EB=93=A4=EC=96=B4=EA=B0=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salesMgmt/transactionStatementForm.jsp | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/WebContent/WEB-INF/view/salesmgmt/salesMgmt/transactionStatementForm.jsp b/WebContent/WEB-INF/view/salesmgmt/salesMgmt/transactionStatementForm.jsp index ccb5bbc..b72fa6a 100644 --- a/WebContent/WEB-INF/view/salesmgmt/salesMgmt/transactionStatementForm.jsp +++ b/WebContent/WEB-INF/view/salesmgmt/salesMgmt/transactionStatementForm.jsp @@ -389,8 +389,38 @@ $(document).ready(function(){ var today = new Date(); var days = ['일', '월', '화', '수', '목', '금', '토']; var dateStr = days[today.getDay()] + "요일, " + (today.getMonth() + 1) + "월 " + today.getDate() + ", " + today.getFullYear(); + + // 표시용 날짜 (한글) $("#deliveryDate").text(dateStr); + + // 전송용 날짜 (YYYY-MM-DD) - hidden input에 저장 + var year = today.getFullYear(); + var month = String(today.getMonth() + 1).padStart(2, '0'); + var day = String(today.getDate()).padStart(2, '0'); + var isoDate = year + "-" + month + "-" + day; + $("#deliveryDateISO").val(isoDate); + fn_loadData(); + + // 날짜 수정 시 ISO 형식도 업데이트 + $("#deliveryDate").on('blur', function() { + var dateText = $(this).text().trim(); + // 날짜 파싱 시도 + try { + // "목요일, 11월 15, 2025" 형식 파싱 + var match = dateText.match(/(\d+)월\s*(\d+),?\s*(\d{4})/); + if (match) { + var year = match[3]; + var month = String(match[1]).padStart(2, '0'); + var day = String(match[2]).padStart(2, '0'); + var isoDate = year + "-" + month + "-" + day; + $("#deliveryDateISO").val(isoDate); + console.log("날짜 업데이트: " + dateText + " → " + isoDate); + } + } catch(e) { + console.error("날짜 파싱 실패:", e); + } + }); }); function fn_loadData() { @@ -555,7 +585,7 @@ function fn_save() { // 수정된 데이터 수집 var data = { projectNos: "${param.projectNos}", - deliveryDate: $("#deliveryDate").text(), + deliveryDate: $("#deliveryDateISO").val(), receiverName: $("#receiverName").text(), registrationNo: $("#registrationNo").text(), supplierName: $("#supplierName").text(), @@ -629,6 +659,7 @@ function fn_close() { 납품일 수요일, 9월 24, 2025 +