fix: convert ISO date strings to timestamps for formatRelativeTime
This commit is contained in:
parent
0a5a4c1a0d
commit
b79183ac76
2 changed files with 3 additions and 3 deletions
|
|
@ -222,10 +222,10 @@ export const APITokenManager: Component<APITokenManagerProps> = (props) => {
|
||||||
<td class="py-2 px-3 text-gray-900 dark:text-gray-100">{token.name || 'Untitled token'}</td>
|
<td class="py-2 px-3 text-gray-900 dark:text-gray-100">{token.name || 'Untitled token'}</td>
|
||||||
<td class="py-2 px-3 font-mono text-xs text-gray-600 dark:text-gray-400">{tokenHint(token)}</td>
|
<td class="py-2 px-3 font-mono text-xs text-gray-600 dark:text-gray-400">{tokenHint(token)}</td>
|
||||||
<td class="py-2 px-3 text-gray-600 dark:text-gray-400">
|
<td class="py-2 px-3 text-gray-600 dark:text-gray-400">
|
||||||
{formatRelativeTime(token.createdAt)}
|
{formatRelativeTime(new Date(token.createdAt).getTime())}
|
||||||
</td>
|
</td>
|
||||||
<td class="py-2 px-3 text-gray-600 dark:text-gray-400">
|
<td class="py-2 px-3 text-gray-600 dark:text-gray-400">
|
||||||
{token.lastUsedAt ? formatRelativeTime(token.lastUsedAt) : 'Never'}
|
{token.lastUsedAt ? formatRelativeTime(new Date(token.lastUsedAt).getTime()) : 'Never'}
|
||||||
</td>
|
</td>
|
||||||
<td class="py-2 px-3 text-right">
|
<td class="py-2 px-3 text-right">
|
||||||
<button
|
<button
|
||||||
|
|
|
||||||
|
|
@ -336,7 +336,7 @@ WantedBy=multi-user.target`;
|
||||||
{token.prefix && token.suffix ? `${token.prefix}…${token.suffix}` : '—'}
|
{token.prefix && token.suffix ? `${token.prefix}…${token.suffix}` : '—'}
|
||||||
</td>
|
</td>
|
||||||
<td class="py-2 px-2 text-gray-600 dark:text-gray-400">
|
<td class="py-2 px-2 text-gray-600 dark:text-gray-400">
|
||||||
{token.lastUsedAt ? formatRelativeTime(token.lastUsedAt) : 'Never'}
|
{token.lastUsedAt ? formatRelativeTime(new Date(token.lastUsedAt).getTime()) : 'Never'}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue