Skip to content

Commit bb1274d

Browse files
committed
Simplifying AppProjects to match Rollouts' string comparison approach
Signed-off-by: Atif Ali <[email protected]>
1 parent 44b7b5f commit bb1274d

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/gitops/components/project/ProjectList.tsx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -288,16 +288,10 @@ export const sortData = (
288288
aValue = a.metadata?.labels || {};
289289
bValue = b.metadata?.labels || {};
290290
break;
291-
case 'last-updated': {
292-
const aTimestamp = getLastUpdateTimestamp(a);
293-
const bTimestamp = getLastUpdateTimestamp(b);
294-
aValue = new Date(aTimestamp || 0).getTime();
295-
bValue = new Date(bTimestamp || 0).getTime();
296-
// Handle NaN values (invalid dates) - treat as 0 (epoch)
297-
if (isNaN(aValue)) aValue = 0;
298-
if (isNaN(bValue)) bValue = 0;
291+
case 'last-updated':
292+
aValue = getLastUpdateTimestamp(a) || '';
293+
bValue = getLastUpdateTimestamp(b) || '';
299294
break;
300-
}
301295
default:
302296
return 0;
303297
}

0 commit comments

Comments
 (0)