Skip to content

Commit 2f61c20

Browse files
committed
Only show time, not date, in collector job datetime columns
1 parent 87576ce commit 2f61c20

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

site/frontend/src/pages/status/collector.vue

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
<script setup lang="tsx">
22
import {h, ref, Ref} from "vue";
3-
import {parseISO, differenceInHours, differenceInSeconds} from "date-fns";
3+
import {
4+
parseISO,
5+
differenceInHours,
6+
differenceInSeconds,
7+
format,
8+
} from "date-fns";
49
import {
510
formatISODate,
611
formatSecondsAsDuration,
@@ -121,6 +126,16 @@ function timeSince(timestamp: string): string {
121126
const diffSeconds = differenceInSeconds(now, date);
122127
return formatSecondsAsDuration(diffSeconds);
123128
}
129+
130+
// Takes a date like `2025-09-10T08:22:47.161348Z` and shows just the time
131+
// portion (`08:22:47`).
132+
function formatTime(dateString: string | null): string {
133+
const date = parseDateIsoStringOrNull(dateString);
134+
if (date === null) {
135+
return "";
136+
}
137+
return format(date, "HH:mm:ss");
138+
}
124139
</script>
125140

126141
<template>
@@ -208,10 +223,10 @@ function timeSince(timestamp: string): string {
208223
{{ formatJobStatus(job.status) }}
209224
</td>
210225
<td :title="`Started ${timeSince(job.startedAt)} ago`">
211-
{{ formatISODate(job.startedAt) }}
226+
{{ formatTime(job.startedAt) }}
212227
</td>
213228
<td>
214-
{{ formatISODate(job.completedAt) }}
229+
{{ formatTime(job.completedAt) }}
215230
</td>
216231
<td>{{ formatJobKind(job.kind) }}</td>
217232
<td>{{ formatBackend(job) }}</td>

0 commit comments

Comments
 (0)