From ec281b989a5cb651d27f93cd8c3446ebe63cd3a7 Mon Sep 17 00:00:00 2001 From: clkim Date: Wed, 4 Mar 2026 18:10:44 +0900 Subject: [PATCH] =?UTF-8?q?fix.=20UTC=20=EC=8B=9C=EA=B0=84=20=ED=91=9C?= =?UTF-8?q?=EA=B8=B0=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/pages/inspection/index.vue | 65 +++++++++++++++++++--------------- 1 file changed, 37 insertions(+), 28 deletions(-) diff --git a/app/pages/inspection/index.vue b/app/pages/inspection/index.vue index 9b4c096..c1cc4c1 100644 --- a/app/pages/inspection/index.vue +++ b/app/pages/inspection/index.vue @@ -30,7 +30,10 @@ {{ tm('Inspection_Maintenance_Time') }}
-
+
@@ -143,40 +146,46 @@ await getInspectionDataExternal({ gameId: gameId.value, }) -// locale에 따라 뒤에 KST 또는 UTC 추가 ko, en, zh-tw, ja -// ko: (KST) -// en: (UTC) -// zh-tw: 台灣時間 (KST) -// ja: (JST) -// 나머지: (KST) +const TIMEZONE_MAP: Record = { + ko: 'KST', + en: 'UTC', + ja: 'JST', + 'zh-tw': '台灣時間', + 'zh-cn': 'CST', + th: 'ICT', +} +const DEFAULT_TIMEZONE = 'KST' + +const formatInspectionDate = (date: number | Date) => { + const currentLocale = locale.value + const nation = currentLocale === 'ko' ? 'KR' : '' + return `${globalDateFormat(date, currentLocale, nation, { useFullDate: true })}` +} + +const formatInspectionUtc = (date: number) => + `${globalDateFormat(date, 'en', '', { + useFullDate: true, + useUtc: true, + })}` + +// locale에 따라 뒤에 KST 또는 UTC 등을 추가 const getLocaleTimezone = () => { const tsStartDate = webInspectionData.value?.ts_start_date || 0 const tsEndDate = webInspectionData.value?.ts_end_date || 0 const currentLocale = locale.value + const timezone = TIMEZONE_MAP[currentLocale] ?? DEFAULT_TIMEZONE - const timezoneMap: Record = { - ko: 'KST', - en: 'UTC', - ja: 'JST', - 'zh-tw': '台灣時間', - 'zh-cn': 'CST', - th: 'ICT', - } - const timezone = timezoneMap[currentLocale] || 'KST' - const defaultRegion = currentLocale === 'ko' ? 'KR' : '' + const localTime = `${formatInspectionDate( + new Date(tsStartDate) + )}
~ ${formatInspectionDate( + new Date(tsEndDate) + )} (${timezone})` - const formatDate = ( - date: Date, - loc: string, - reg: string, - { useUtc }: { useUtc: boolean } = { useUtc: false } - ) => - `${globalDateFormat(date, loc, reg || defaultRegion, { useFullDate: true, useUtc: useUtc })}` + const utcTime = `${formatInspectionUtc( + tsStartDate + )}
~ ${formatInspectionUtc(tsEndDate)} (UTC)` - const localTime = `${formatDate(new Date(tsStartDate), currentLocale, '')}
~ ${formatDate(new Date(tsEndDate), currentLocale, '')} (${timezone})` - const utcTime = `${formatDate(new Date(tsStartDate), 'en', '', { useUtc: true })}
~ ${formatDate(new Date(tsEndDate), 'en', '', { useUtc: true })} (UTC)` - - return currentLocale === 'en' ? utcTime : `${localTime}
${utcTime}` + return currentLocale === 'en' ? localTime : `${localTime}
${utcTime}` } const launchingStatus = computed(() => {