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