Merge pull request #23890 from adamdmharvey/adamdmharvey/home-time-relative

feat(home): Show relative time for recent visits from today
This commit is contained in:
Djam
2024-04-17 11:26:34 +02:00
committed by GitHub
2 changed files with 6 additions and 3 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-home': patch
---
Use relative time when displaying visits from the same day
@@ -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()}
</Typography>
);
};