Skip to content

Commit

Permalink
feat(ui): display exact timestamp in the last seen device list field (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
silentroach authored Oct 15, 2024
1 parent 6e31bc2 commit 772428c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/LastSeen.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { DeviceState, LastSeenType } from '../types';
import { format } from 'timeago.js';
import { lastSeen } from '../utils';
import { lastSeen, formatDate } from '../utils';

import { useTranslation } from 'react-i18next';

Expand All @@ -14,7 +14,7 @@ export function LastSeen(props: LastSeenProps): JSX.Element {
const { state, lastSeenType } = props;
const lastSeenDate = lastSeen(state, lastSeenType);
if (lastSeenDate) {
return <>{format(lastSeenDate, i18n.language)}</>;
return <span title={formatDate(lastSeenDate)}>{format(lastSeenDate, i18n.language)}</span>;
} else {
return <>N/A</>;
}
Expand Down

0 comments on commit 772428c

Please sign in to comment.