diff --git a/src/components/inquiry/Answer.tsx b/src/components/inquiry/Answer.tsx
index 4df9c3b..3bae3fd 100644
--- a/src/components/inquiry/Answer.tsx
+++ b/src/components/inquiry/Answer.tsx
@@ -15,7 +15,7 @@ export default function Answer({
Hanwha Japan 回答
- {inquiryDetail?.ansRegNm}/ {inquiryDetail?.ansRegDt}
+ {inquiryDetail?.ansRegNm} / {inquiryDetail?.ansRegDt}
diff --git a/src/components/popup/SurveySaleSubmitPopup.tsx b/src/components/popup/SurveySaleSubmitPopup.tsx
index 4c8b4fa..9104989 100644
--- a/src/components/popup/SurveySaleSubmitPopup.tsx
+++ b/src/components/popup/SurveySaleSubmitPopup.tsx
@@ -176,11 +176,11 @@ export default function SurveySaleSubmitPopup() {
-販売店名:
- ${surveyDetail?.store} (${surveyDetail?.storeId ?? ' - '})
+ ${surveyDetail?.store ? `${surveyDetail?.store} (${surveyDetail?.storeId ?? ' - '})` : ' - '}
- -施工店名:
+ -施工店名:
${surveyDetail?.constructionPoint ?? ' - '}
diff --git a/src/components/survey-sale/detail/DataTable.tsx b/src/components/survey-sale/detail/DataTable.tsx
index d293a7e..7dfd5b1 100644
--- a/src/components/survey-sale/detail/DataTable.tsx
+++ b/src/components/survey-sale/detail/DataTable.tsx
@@ -2,6 +2,7 @@
import { SurveyBasicInfo } from '@/types/Survey'
import { useSurvey } from '@/hooks/useSurvey'
+import { formatDateTime } from '@/utils/common-utils'
export default function DataTable({ surveyDetail }: { surveyDetail: SurveyBasicInfo }) {
/** 제출 상태 처리 */
@@ -36,18 +37,18 @@ export default function DataTable({ surveyDetail }: { surveyDetail: SurveyBasicI
| 登録日 |
- {surveyDetail?.regDt ? new Date(surveyDetail.regDt).toLocaleString() : ''} |
+ {formatDateTime(surveyDetail?.regDt)} |
| 更新日時 |
- {surveyDetail?.uptDt ? new Date(surveyDetail.uptDt).toLocaleString() : ''} |
+ {formatDateTime(surveyDetail?.uptDt)} |
| 提出可否 |
{surveyDetail?.submissionStatus && surveyDetail?.submissionDate ? (
<>
- {new Date(surveyDetail.submissionDate).toLocaleString()}
+ {formatDateTime(surveyDetail.submissionDate)}
{submitStatus()}
>
) : (
diff --git a/src/components/survey-sale/detail/RoofForm.tsx b/src/components/survey-sale/detail/RoofForm.tsx
index d6d97e0..ff3d0c9 100644
--- a/src/components/survey-sale/detail/RoofForm.tsx
+++ b/src/components/survey-sale/detail/RoofForm.tsx
@@ -74,7 +74,7 @@ export default function RoofForm(props: {
電気契約容量
{mode === 'READ' && }
{mode !== 'READ' && (
-
+
handleNumberInput('contractCapacity', e.target.value)}
/>
-
+
diff --git a/src/components/ui/common/Header.tsx b/src/components/ui/common/Header.tsx
index f217359..e155e17 100644
--- a/src/components/ui/common/Header.tsx
+++ b/src/components/ui/common/Header.tsx
@@ -146,7 +146,7 @@ export default function Header() {
-
+
diff --git a/src/utils/common-utils.js b/src/utils/common-utils.js
index fdef02e..56ec813 100644
--- a/src/utils/common-utils.js
+++ b/src/utils/common-utils.js
@@ -233,3 +233,40 @@ export const convertToCamelCase = (obj) => {
return obj
}
+
+/**
+ * 날짜 형식 변환
+ * @param {Date | string} date 날짜 데이터
+ * @returns {string} 포맷팅된 날짜 문자열 (YYYY.MM.DD HH:MM:SS)
+ */
+export const formatDateTime = (date) => {
+ if (date === '' || date === null || date === undefined) return ''
+
+ return new Date(date)
+ .toLocaleString(undefined, {
+ year: 'numeric',
+ month: 'numeric',
+ day: 'numeric',
+ hour: '2-digit',
+ minute: '2-digit',
+ second: '2-digit',
+ hour12: false,
+ })
+ .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}`
+}
|