feat: 테이블 리스트 날짜 형식을 yyyy-mm-dd로 변경
- inputType이 date/datetime인 컬럼 yyyy-mm-dd 형식으로 표시 - format이 'date'인 경우도 동일한 형식 적용 - 생성일, 수정일 등 날짜 컬럼 가독성 개선 변경된 파일: - frontend/lib/registry/components/table-list/TableListComponent.tsx
This commit is contained in:
parent
dad7e9edab
commit
2722ebb218
|
|
@ -1200,6 +1200,22 @@ export const TableListComponent: React.FC<TableListComponentProps> = ({
|
|||
return String(value);
|
||||
}
|
||||
|
||||
// 날짜 타입 포맷팅 (yyyy-mm-dd)
|
||||
if (inputType === "date" || inputType === "datetime") {
|
||||
if (value) {
|
||||
try {
|
||||
const date = new Date(value);
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
return `${year}-${month}-${day}`;
|
||||
} catch {
|
||||
return String(value);
|
||||
}
|
||||
}
|
||||
return "-";
|
||||
}
|
||||
|
||||
// 숫자 타입 포맷팅
|
||||
if (inputType === "number" || inputType === "decimal") {
|
||||
if (value !== null && value !== undefined && value !== "") {
|
||||
|
|
@ -1224,7 +1240,10 @@ export const TableListComponent: React.FC<TableListComponentProps> = ({
|
|||
if (value) {
|
||||
try {
|
||||
const date = new Date(value);
|
||||
return date.toLocaleDateString("ko-KR");
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
return `${year}-${month}-${day}`;
|
||||
} catch {
|
||||
return value;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue