diff --git a/src/components/survey-sale/list/ListTable.tsx b/src/components/survey-sale/list/ListTable.tsx index 8e1de6b..19cbec4 100644 --- a/src/components/survey-sale/list/ListTable.tsx +++ b/src/components/survey-sale/list/ListTable.tsx @@ -8,7 +8,7 @@ import SearchForm from './SearchForm' import { useSurveyFilterStore } from '@/store/surveyFilterStore' import { useSessionStore } from '@/store/session' import type { SurveyBasicInfo } from '@/types/Survey' -import { formatDateTime } from '@/utils/common-utils' +import { formatDateTime, formatDate } from '@/utils/common-utils' export default function ListTable() { const router = useRouter() @@ -69,7 +69,7 @@ export default function ListTable() {
{survey.srlNo}
-
{survey.investigationDate}
+
{formatDate(survey.regDt)}
{survey.buildingName === null ? '-' : survey.buildingName}
{survey.customerName === null ? '-' : survey.customerName}
diff --git a/src/utils/common-utils.js b/src/utils/common-utils.js index 7c2b359..56ec813 100644 --- a/src/utils/common-utils.js +++ b/src/utils/common-utils.js @@ -254,3 +254,19 @@ export const formatDateTime = (date) => { }) .replace(/\//g, '.') } + +/** + * 날짜만 형식 변환 + * @param {Date | string} date 날짜 데이터 + * @returns {string} 포맷팅된 날짜 문자열 (YYYY.MM.DD) + */ +export const formatDate = (date) => { + if (date === '' || date === null || date === undefined) return '' + + const dateObj = new Date(date) + const year = dateObj.getFullYear() + const month = String(dateObj.getMonth() + 1).padStart(2, '0') + const day = String(dateObj.getDate()).padStart(2, '0') + + return `${year}.${month}.${day}` +}