mirror of
https://github.com/remnawave/frontend.git
synced 2026-05-13 12:16:40 +00:00
feat: replace dayjs with formatTimeUtil for date formatting in UserHwidDeviceItem
This commit is contained in:
parent
a2e07fb4af
commit
469cf0b8ea
1 changed files with 12 additions and 5 deletions
|
|
@ -9,10 +9,10 @@ import {
|
|||
import { ActionIcon, Divider, Group, Stack, Text, ThemeIcon } from '@mantine/core'
|
||||
import { GetUserHwidDevicesCommand } from '@remnawave/backend-contract'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import dayjs from 'dayjs'
|
||||
|
||||
import { CopyableFieldShared } from '@shared/ui/copyable-field/copyable-field'
|
||||
import { SettingsCardShared } from '@shared/ui/settings-card'
|
||||
import { formatTimeUtil } from '@shared/utils/time-utils'
|
||||
|
||||
interface IProps {
|
||||
device: GetUserHwidDevicesCommand.Response['response']['devices'][number]
|
||||
|
|
@ -22,8 +22,7 @@ interface IProps {
|
|||
|
||||
export const UserHwidDeviceItem = (props: IProps) => {
|
||||
const { index, device, onDelete } = props
|
||||
|
||||
const { t } = useTranslation()
|
||||
const { t, i18n } = useTranslation()
|
||||
|
||||
const resolvePlatform = (platform: null | string) => {
|
||||
if (!platform) return <PiDeviceMobile size={24} />
|
||||
|
|
@ -101,13 +100,21 @@ export const UserHwidDeviceItem = (props: IProps) => {
|
|||
<CopyableFieldShared
|
||||
label={t('get-hwid-user-devices.feature.added')}
|
||||
size="sm"
|
||||
value={dayjs(device.createdAt).format('HH:mm DD MMMM, YYYY')}
|
||||
value={formatTimeUtil({
|
||||
time: device.createdAt,
|
||||
template: 'TIME_FIRST_DATETIME',
|
||||
language: i18n.language
|
||||
})}
|
||||
/>
|
||||
|
||||
<CopyableFieldShared
|
||||
label="Updated"
|
||||
size="sm"
|
||||
value={dayjs(device.updatedAt).format('HH:mm DD MMMM, YYYY')}
|
||||
value={formatTimeUtil({
|
||||
time: device.updatedAt,
|
||||
template: 'TIME_FIRST_DATETIME',
|
||||
language: i18n.language
|
||||
})}
|
||||
/>
|
||||
</Stack>
|
||||
</SettingsCardShared.Content>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue