fix: 到期时间列直接显示日期时间而非剩余天数
This commit is contained in:
@@ -119,11 +119,13 @@ export function getColumns(actions: {
|
|||||||
return h(Badge, { variant: 'destructive' }, () => t('developer.users.expiry.expired'))
|
return h(Badge, { variant: 'destructive' }, () => t('developer.users.expiry.expired'))
|
||||||
}
|
}
|
||||||
|
|
||||||
const daysLeft = Math.ceil((date.getTime() - now.getTime()) / (1000 * 60 * 60 * 24))
|
return h('span', {}, date.toLocaleString('zh-CN', {
|
||||||
return h('div', { class: 'flex flex-col' }, [
|
year: 'numeric',
|
||||||
h('span', { class: 'text-green-600 font-medium' }, `${daysLeft} ${t('developer.users.expiry.daysLeft')}`),
|
month: '2-digit',
|
||||||
h('span', { class: 'text-xs text-muted-foreground' }, date.toLocaleDateString('zh-CN')),
|
day: '2-digit',
|
||||||
])
|
hour: '2-digit',
|
||||||
|
minute: '2-digit',
|
||||||
|
}))
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
return '-'
|
return '-'
|
||||||
|
|||||||
Reference in New Issue
Block a user