Browse Source

remove dateTime helper

pull/1572/head
Bernd Storath 3 months ago
parent
commit
5261c30f7e
  1. 2
      src/app/components/ClientCard/LastSeen.vue
  2. 11
      src/app/utils/math.ts

2
src/app/components/ClientCard/LastSeen.vue

@ -2,7 +2,7 @@
<span
v-if="client.latestHandshakeAt"
class="whitespace-nowrap text-gray-400 dark:text-neutral-500"
:title="$t('lastSeen') + dateTime(new Date(client.latestHandshakeAt))"
:title="$t('lastSeen') + $d(new Date(client.latestHandshakeAt))"
>
· {{ timeago(new Date(client.latestHandshakeAt)) }}
</span>

11
src/app/utils/math.ts

@ -20,17 +20,6 @@ export function bytes(
return `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${sizes[i]}`;
}
export function dateTime(value: Date) {
// TODO: results in mismatch because of different locales
return new Intl.DateTimeFormat(undefined, {
year: 'numeric',
month: 'short',
day: 'numeric',
hour: 'numeric',
minute: 'numeric',
}).format(value);
}
/**
* Sorts an array of objects by a specified property in ascending or descending order.
*

Loading…
Cancel
Save