fix: 조사매물 목록 등록일 표시형식 수정
This commit is contained in:
parent
8be01dae44
commit
29771cbde6
@ -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() {
|
||||
<div className="sale-item-bx">
|
||||
<div className="sale-item-date-bx">
|
||||
<div className="sale-item-num">{survey.srlNo}</div>
|
||||
<div className="sale-item-date">{survey.investigationDate}</div>
|
||||
<div className="sale-item-date">{formatDate(survey.regDt)}</div>
|
||||
</div>
|
||||
<div className="sale-item-tit">{survey.buildingName === null ? '-' : survey.buildingName}</div>
|
||||
<div className="sale-item-customer">{survey.customerName === null ? '-' : survey.customerName}</div>
|
||||
|
||||
@ -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}`
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user