From 3c9a95332298450c7e0f75bfb08944439e1a3739 Mon Sep 17 00:00:00 2001 From: dujinkim Date: Mon, 1 Dec 2025 03:09:00 +0000 Subject: (최겸)구매 일반계약 템플릿 자동 연동 및 매핑 기능 추가 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/general-contracts-table-columns.tsx | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'lib/general-contracts/main/general-contracts-table-columns.tsx') diff --git a/lib/general-contracts/main/general-contracts-table-columns.tsx b/lib/general-contracts/main/general-contracts-table-columns.tsx index 0b3143fe..c43bb383 100644 --- a/lib/general-contracts/main/general-contracts-table-columns.tsx +++ b/lib/general-contracts/main/general-contracts-table-columns.tsx @@ -368,14 +368,27 @@ export function getGeneralContractsColumns({ setRowAction }: GetColumnsProps): C if (!startDate || !endDate) return - + // UI 표시용 KST 변환 (YYYY-MM-DD) + const formatKstDate = (d: string | Date) => { + const date = new Date(d) + return new Date(date.getTime() + 9 * 60 * 60 * 1000).toISOString().slice(0, 10) + } + + const formattedStart = formatKstDate(startDate) + const formattedEnd = formatKstDate(endDate) + const now = new Date() - const isActive = now >= new Date(startDate) && now <= new Date(endDate) - const isExpired = now > new Date(endDate) + const startObj = new Date(startDate) + const endObj = new Date(endDate) + + // 종료일의 경우 23:59:59까지 유효하다고 가정하거나, 단순히 날짜 비교 + const isActive = now >= startObj && now <= new Date(endObj.getTime() + 24 * 60 * 60 * 1000 - 1) + const isExpired = now > new Date(endObj.getTime() + 24 * 60 * 60 * 1000 - 1) return (
- {formatDate(startDate, "KR")} ~ {formatDate(endDate, "KR")} + {formattedStart} ~ {formattedEnd}
{isActive && ( 진행중 -- cgit v1.2.3