From 9e61d792b7ce701d2d3f3262a7f5bda9ebdcd3b4 Mon Sep 17 00:00:00 2001 From: Adam Harvey <33203301+adamdmharvey@users.noreply.github.com> Date: Thu, 28 Mar 2024 10:51:53 -0400 Subject: [PATCH 1/2] feat(home): Show relative times for recent visits from today Signed-off-by: Adam Harvey <33203301+adamdmharvey@users.noreply.github.com> --- plugins/home/src/components/VisitList/ItemDetail.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/plugins/home/src/components/VisitList/ItemDetail.tsx b/plugins/home/src/components/VisitList/ItemDetail.tsx index fed8c5549c..832803800c 100644 --- a/plugins/home/src/components/VisitList/ItemDetail.tsx +++ b/plugins/home/src/components/VisitList/ItemDetail.tsx @@ -35,9 +35,7 @@ const ItemDetailTimeAgo = ({ visit }: { visit: Visit }) => { color="textSecondary" dateTime={visitDate.toISO() ?? undefined} > - {visitDate >= DateTime.now().startOf('day') - ? visitDate.toFormat('HH:mm') - : visitDate.toRelative()} + {visitDate.toRelative()} ); }; From 2196d3eeb65c296d7dc7d302cba6eb4bd422b4c1 Mon Sep 17 00:00:00 2001 From: Adam Harvey <33203301+adamdmharvey@users.noreply.github.com> Date: Thu, 28 Mar 2024 10:52:06 -0400 Subject: [PATCH 2/2] chore: Add changeset Signed-off-by: Adam Harvey <33203301+adamdmharvey@users.noreply.github.com> --- .changeset/chilly-fireants-roll.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/chilly-fireants-roll.md diff --git a/.changeset/chilly-fireants-roll.md b/.changeset/chilly-fireants-roll.md new file mode 100644 index 0000000000..93c05fecb7 --- /dev/null +++ b/.changeset/chilly-fireants-roll.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-home': patch +--- + +Use relative time when displaying visits from the same day