Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion src/feature/photo-detail/components/SectionPhotoData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,22 @@ interface SectionPhotoDataProps {
onAfterDelete?: () => void;
}

// 촬영 시각: 사진 EXIF 시간 그대로 표시 (타임존 변환 안 함)
const formatCaptureTime = (isoString?: string): string => {
if (!isoString) return '';

// ISO 문자열에서 직접 파싱 (타임존 변환 없이)
const match = isoString.match(
/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})/,
);
if (!match) return '정보 없음';

const [, year, month, day, hour, minute] = match;

return `${year}년 ${month}월 ${day}일 ${hour}시 ${minute}분`;
};

// 업로드 시각: UTC를 로컬 시간(KST)으로 변환
const formatKoreanDateTime = (isoString?: string): string => {
if (!isoString) return '';

Expand Down Expand Up @@ -65,7 +81,7 @@ export default function SectionPhotoData({
<div className='flex items-center justify-between'>
<dt className='text-text-subtle w-1/3'>촬영 시각</dt>
<dd className='text-text-subtler flex-1'>
{formatKoreanDateTime(data?.captureTime)}
{formatCaptureTime(data?.captureTime)}
</dd>
</div>
<div className='flex items-center justify-between'>
Expand Down
Loading