fix. [ECW-18] 점검 시간 UTC 시간 오류 수정
This commit is contained in:
@@ -30,10 +30,7 @@
|
|||||||
{{ tm('Inspection_Maintenance_Time') }}
|
{{ tm('Inspection_Maintenance_Time') }}
|
||||||
</h2>
|
</h2>
|
||||||
<div class="inspection-time text-sm md:text-base font-medium">
|
<div class="inspection-time text-sm md:text-base font-medium">
|
||||||
<div
|
<div v-dompurify-html="getLocaleTimezone" class="time-row"></div>
|
||||||
v-dompurify-html="getLocaleTimezone('', '')"
|
|
||||||
class="time-row"
|
|
||||||
></div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -152,10 +149,10 @@ await getInspectionDataExternal({
|
|||||||
// zh-tw: 台灣時間 (KST)
|
// zh-tw: 台灣時間 (KST)
|
||||||
// ja: (JST)
|
// ja: (JST)
|
||||||
// 나머지: (KST)
|
// 나머지: (KST)
|
||||||
const getLocaleTimezone = (localeType: string, region) => {
|
const getLocaleTimezone = () => {
|
||||||
const tsStartDate = webInspectionData.value?.ts_start_date || 0
|
const tsStartDate = webInspectionData.value?.ts_start_date || 0
|
||||||
const tsEndDate = webInspectionData.value?.ts_end_date || 0
|
const tsEndDate = webInspectionData.value?.ts_end_date || 0
|
||||||
const currentLocale = localeType || locale.value
|
const currentLocale = locale.value
|
||||||
|
|
||||||
const timezoneMap: Record<string, string> = {
|
const timezoneMap: Record<string, string> = {
|
||||||
ko: 'KST',
|
ko: 'KST',
|
||||||
@@ -168,11 +165,16 @@ const getLocaleTimezone = (localeType: string, region) => {
|
|||||||
const timezone = timezoneMap[currentLocale] || 'KST'
|
const timezone = timezoneMap[currentLocale] || 'KST'
|
||||||
const defaultRegion = currentLocale === 'ko' ? 'KR' : ''
|
const defaultRegion = currentLocale === 'ko' ? 'KR' : ''
|
||||||
|
|
||||||
const formatDate = (date: Date, loc: string, reg: string) =>
|
const formatDate = (
|
||||||
`${globalDateFormat(date, loc, reg || defaultRegion, { useFullDate: true })}`
|
date: Date,
|
||||||
|
loc: string,
|
||||||
|
reg: string,
|
||||||
|
{ useUtc }: { useUtc: boolean } = { useUtc: false }
|
||||||
|
) =>
|
||||||
|
`${globalDateFormat(date, loc, reg || defaultRegion, { useFullDate: true, useUtc: useUtc })}`
|
||||||
|
|
||||||
const localTime = `${formatDate(new Date(tsStartDate), currentLocale, region || '')} <br class="md:hidden">~ ${formatDate(new Date(tsEndDate), currentLocale, region || '')} (${timezone})`
|
const localTime = `${formatDate(new Date(tsStartDate), currentLocale, '')} <br class="md:hidden">~ ${formatDate(new Date(tsEndDate), currentLocale, '')} (${timezone})`
|
||||||
const utcTime = `${formatDate(new Date(tsStartDate), 'en', region || '')} <br class="md:hidden">~ ${formatDate(new Date(tsEndDate), 'en', region || '')} (UTC)`
|
const utcTime = `${formatDate(new Date(tsStartDate), 'en', '', { useUtc: true })} <br class="md:hidden">~ ${formatDate(new Date(tsEndDate), 'en', '', { useUtc: true })} (UTC)`
|
||||||
|
|
||||||
return currentLocale === 'en' ? utcTime : `${localTime}<br>${utcTime}`
|
return currentLocale === 'en' ? utcTime : `${localTime}<br>${utcTime}`
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user