From 5d3b3ea76eecec237d4995fc9281797cff376835 Mon Sep 17 00:00:00 2001 From: SeongHyun Kim Date: Fri, 5 Dec 2025 10:13:59 +0900 Subject: [PATCH] =?UTF-8?q?fix(modal-repeater-table):=20=EB=82=A0=EC=A7=9C?= =?UTF-8?q?=20=ED=95=84=EB=93=9C=20ISO=20=ED=98=95=EC=8B=9D=20=EB=B3=80?= =?UTF-8?q?=ED=99=98=EC=9C=BC=EB=A1=9C=20=ED=91=9C=EC=8B=9C=20=EC=98=A4?= =?UTF-8?q?=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - RepeaterTable에서 DB 조회된 ISO 형식 날짜를 yyyy-mm-dd로 변환 - formatDateValue 함수 추가: ISO 문자열, Date 객체, 기존 형식 모두 처리 - 수주일(order_date), 납기일(item_due_date) 등 날짜 필드 정상 표시 --- .../modal-repeater-table/RepeaterTable.tsx | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/frontend/lib/registry/components/modal-repeater-table/RepeaterTable.tsx b/frontend/lib/registry/components/modal-repeater-table/RepeaterTable.tsx index c9aa2cfd..703256b2 100644 --- a/frontend/lib/registry/components/modal-repeater-table/RepeaterTable.tsx +++ b/frontend/lib/registry/components/modal-repeater-table/RepeaterTable.tsx @@ -75,10 +75,28 @@ export function RepeaterTable({ ); case "date": + // ISO 형식(2025-11-23T00:00:00.000Z)을 yyyy-mm-dd로 변환 + const formatDateValue = (val: any): string => { + if (!val) return ""; + // 이미 yyyy-mm-dd 형식이면 그대로 반환 + if (typeof val === "string" && /^\d{4}-\d{2}-\d{2}$/.test(val)) { + return val; + } + // ISO 형식이면 날짜 부분만 추출 + if (typeof val === "string" && val.includes("T")) { + return val.split("T")[0]; + } + // Date 객체이면 변환 + if (val instanceof Date) { + return val.toISOString().split("T")[0]; + } + return String(val); + }; + return ( handleCellEdit(rowIndex, column.field, e.target.value)} className="h-7 text-xs" />