fix(bb): robust date sorting in Bulletin Board list

This commit is contained in:
Scott Idem
2026-02-12 15:21:44 -05:00
parent 64be14249c
commit 5e9457580c

View File

@@ -72,9 +72,10 @@
.toArray();
// SORT: Most recently updated or created at the top (Refactored 2026-02-05)
// ROBUSTNESS: Ensure fallback to 0 to prevent NaN comparison issues
results.sort((a, b) => {
const date_a = new Date(a.updated_on ?? a.created_on).getTime();
const date_b = new Date(b.updated_on ?? b.created_on).getTime();
const date_a = new Date(a.updated_on ?? a.created_on ?? 0).getTime() || 0;
const date_b = new Date(b.updated_on ?? b.created_on ?? 0).getTime() || 0;
return date_b - date_a;
});