chpark-sync #425

Merged
kjs merged 293 commits from chpark-sync into main 2026-03-23 09:36:36 +09:00
1 changed files with 19 additions and 1 deletions
Showing only changes of commit 07fe4baf9f - Show all commits

View File

@ -75,10 +75,28 @@ export function RepeaterTable({
); );
case "date": 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 ( return (
<Input <Input
type="date" type="date"
value={value || ""} value={formatDateValue(value)}
onChange={(e) => handleCellEdit(rowIndex, column.field, e.target.value)} onChange={(e) => handleCellEdit(rowIndex, column.field, e.target.value)}
className="h-7 text-xs" className="h-7 text-xs"
/> />