Skip to content

Commit 9732b30

Browse files
committed
fix(fail2ban): sort banned IPs by timestamp via orthogonal data
Previous code wrapped the formatted DD.MM.YYYY HH:MM string in <span data-order="${timestamp}">, expecting DataTables to read the attribute for sort. DataTables only inspects data-order on the <td> itself, so the attribute was ignored and the visible string was sorted lexicographically (05.05.2026 landed before 30.04.2026). Switch the "Ban date" and "Expires" columns to DataTables orthogonal data: store the raw unix timestamp in the row, format only when type === 'display'. Missing timestamps pushed as null so they sort to the end on ascending order. Guard the display branch with Number.isFinite(data) && data > 0 to keep stray Infinity/NaN from producing "NaN.NaN.NaN NaN:NaN".
1 parent 88c0574 commit 9732b30

2 files changed

Lines changed: 61 additions & 19 deletions

File tree

0 commit comments

Comments
 (0)