From 4f87f40a0e91cc1122f325a96e9e8a369b75e2d1 Mon Sep 17 00:00:00 2001 From: Jay Sheen Date: Tue, 4 Nov 2025 10:07:57 +0900 Subject: [PATCH] Localize home notice date format based on language MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add formatDate function to display dates based on current language - Korean (ko): YY년 MM월 DD일 format (e.g., 25년 10월 31일) - English (en): YYYY.MM.DD format (e.g., 2025.10.31) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/entities/home/ui/home-notice-item.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/entities/home/ui/home-notice-item.tsx b/src/entities/home/ui/home-notice-item.tsx index c869d0e..124d292 100644 --- a/src/entities/home/ui/home-notice-item.tsx +++ b/src/entities/home/ui/home-notice-item.tsx @@ -10,7 +10,16 @@ export const HomeNoticeItem = ({ setDetailData, }: NoticeItemProps) => { const { navigate } = useNavigate(); - const { t } = useTranslation(); + const { t, i18n } = useTranslation(); + + const formatDate = (date?: string) => { + if (!date) return ''; + const currentLang = i18n.language; + if (currentLang === 'ko') { + return moment(date).format('YY년 MM월 DD일'); + } + return moment(date).format('YYYY.MM.DD'); + }; const onClickToDetail = () => { if(setDetailData){ @@ -29,7 +38,7 @@ export const HomeNoticeItem = ({ >
{ noticeItem.title }
-
{ t(`support.notice.categories.${noticeItem.informCl}`) }{ noticeItem.regDt? moment(noticeItem.regDt).format('YYYY.MM.DD'): '' }
+
{ t(`support.notice.categories.${noticeItem.informCl}`) }{ formatDate(noticeItem.regDt) }