Skip to content

Commit 5242ad4

Browse files
authored
fix: sort ANS104 dataitems before displaying
1 parent 05b3f7c commit 5242ad4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ui/home/LatestDataItems.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,13 @@ const LatestDataItems = () => {
1919
}
2020

2121
if (items) {
22-
const dataToShow = items.slice(0, itemsCount);
22+
const sorted = [...items].sort((a, b) => {
23+
const aTime = a.LastModified ? new Date(a.LastModified).getTime() : 0;
24+
const bTime = b.LastModified ? new Date(b.LastModified).getTime() : 0;
25+
return bTime - aTime;
26+
});
27+
28+
const dataToShow = sorted.slice(0, itemsCount);
2329

2430
content = (
2531
<VStack spacing={ 2 } overflow="hidden" alignItems="stretch">

0 commit comments

Comments
 (0)