Feat: frontend support timezone of timestamp (#4070)

This commit is contained in:
KVOJJJin
2024-05-04 16:15:32 +08:00
committed by GitHub
parent f68b6b0e5e
commit c0476c7881
15 changed files with 88 additions and 58 deletions

View File

@@ -1,8 +1,7 @@
'use client'
import type { FC } from 'react'
import { useTranslation } from 'react-i18next'
// import cn from 'classnames'
import dayjs from 'dayjs'
import useTimestamp from '@/hooks/use-timestamp'
type Props = {
status: string
@@ -24,6 +23,7 @@ const MetaData: FC<Props> = ({
showSteps = true,
}) => {
const { t } = useTranslation()
const { formatTime } = useTimestamp()
return (
<div className='relative'>
@@ -64,7 +64,7 @@ const MetaData: FC<Props> = ({
<div className='my-[5px] w-[72px] h-2 rounded-sm bg-[rgba(0,0,0,0.05)]'/>
)}
{status !== 'running' && (
<span>{dayjs(startTime * 1000).format('YYYY-MM-DD hh:mm:ss')}</span>
<span>{formatTime(startTime, t('appLog.dateTimeFormat') as string)}</span>
)}
</div>
</div>