Skip to content

Commit

Permalink
Add timestamps to package task display (fixes #832)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcantelon committed May 7, 2024
1 parent 3102539 commit d977467
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions dashboard/src/components/PreservationActionCollapse.vue
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ watch($$(expandCounter), () => show());
<tr>
<th scope="col">Task #</th>
<th scope="col">Name</th>
<th scope="col">Start</th>
<th scope="col">End</th>
<th scope="col">Outcome</th>
<th scope="col">Notes</th>
</tr>
Expand All @@ -125,6 +127,8 @@ watch($$(expandCounter), () => show());
>
<td>{{ action.tasks.length - index }}</td>
<td>{{ task.name }}</td>
<td>{{ $filters.formatDateTime(task.startedAt) }}</td>
<td>{{ $filters.formatDateTime(task.completedAt) }}</td>
<td>
<StatusBadge :status="task.status" />
</td>
Expand Down
6 changes: 3 additions & 3 deletions dashboard/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ declare module "@vue/runtime-core" {
app.config.globalProperties.$filters = {
formatDateTimeString(value: string) {
const date = new Date(value);
return moment(String(date)).format("YYYY-MM-DD HH:mm:ss");
return moment(date).format("YYYY-MM-DD HH:mm:ss");
},
formatDateTime(value: Date | undefined) {
if (!value) {
if (!value || Number.isNaN(value.getTime())) {
return "";
}
return moment(String(value)).format("YYYY-MM-DD HH:mm:ss");
return moment(value).format("YYYY-MM-DD HH:mm:ss");
},
formatDuration(from: Date, to: Date) {
const diff = moment(to).diff(from);
Expand Down

0 comments on commit d977467

Please sign in to comment.