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:
@@ -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>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user