날짜수정 잘 들어감
This commit is contained in:
@@ -389,8 +389,38 @@ $(document).ready(function(){
|
|||||||
var today = new Date();
|
var today = new Date();
|
||||||
var days = ['일', '월', '화', '수', '목', '금', '토'];
|
var days = ['일', '월', '화', '수', '목', '금', '토'];
|
||||||
var dateStr = days[today.getDay()] + "요일, " + (today.getMonth() + 1) + "월 " + today.getDate() + ", " + today.getFullYear();
|
var dateStr = days[today.getDay()] + "요일, " + (today.getMonth() + 1) + "월 " + today.getDate() + ", " + today.getFullYear();
|
||||||
|
|
||||||
|
// 표시용 날짜 (한글)
|
||||||
$("#deliveryDate").text(dateStr);
|
$("#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();
|
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() {
|
function fn_loadData() {
|
||||||
@@ -555,7 +585,7 @@ function fn_save() {
|
|||||||
// 수정된 데이터 수집
|
// 수정된 데이터 수집
|
||||||
var data = {
|
var data = {
|
||||||
projectNos: "${param.projectNos}",
|
projectNos: "${param.projectNos}",
|
||||||
deliveryDate: $("#deliveryDate").text(),
|
deliveryDate: $("#deliveryDateISO").val(),
|
||||||
receiverName: $("#receiverName").text(),
|
receiverName: $("#receiverName").text(),
|
||||||
registrationNo: $("#registrationNo").text(),
|
registrationNo: $("#registrationNo").text(),
|
||||||
supplierName: $("#supplierName").text(),
|
supplierName: $("#supplierName").text(),
|
||||||
@@ -629,6 +659,7 @@ function fn_close() {
|
|||||||
<td class="date-label-cell">납품일</td>
|
<td class="date-label-cell">납품일</td>
|
||||||
<td class="date-value-cell" colspan="4">
|
<td class="date-value-cell" colspan="4">
|
||||||
<span id="deliveryDate" contenteditable="true">수요일, 9월 24, 2025</span>
|
<span id="deliveryDate" contenteditable="true">수요일, 9월 24, 2025</span>
|
||||||
|
<input type="hidden" id="deliveryDateISO" value="">
|
||||||
</td>
|
</td>
|
||||||
<td class="supplier-label-cell" rowspan="5">
|
<td class="supplier-label-cell" rowspan="5">
|
||||||
<div style="display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%;">
|
<div style="display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%;">
|
||||||
|
|||||||
Reference in New Issue
Block a user