From 8493ec0c90cdc5ca44a280780e077cdffdf82ede Mon Sep 17 00:00:00 2001 From: Michael Manganiello Date: Sun, 22 Jun 2025 20:45:33 -0300 Subject: [PATCH] fix: Table sorting for ID and date columns (#802) The usage of `parseFloat` was breaking the sorting of ID and date columns in the table. This is because `parseFloat("000-123")` returns `0` instead of `123` or `NaN`, and `parseFloat("2025-01-02T03:04:05.678Z")` returns `2025`. Replacing `parseFloat` with `Number` fixes the issue, as now the values received for Asset ID and date columns will correctly return `NaN`, and end up being sorted as strings. --- frontend/components/Item/View/Table.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/components/Item/View/Table.vue b/frontend/components/Item/View/Table.vue index a4e99793..c2741476 100644 --- a/frontend/components/Item/View/Table.vue +++ b/frontend/components/Item/View/Table.vue @@ -256,8 +256,8 @@ function extractSortable(item: ItemSummary, property: keyof ItemSummary): string | number | boolean { const value = item[property]; if (typeof value === "string") { - // Try parse float - const parsed = parseFloat(value); + // Try to parse number + const parsed = Number(value); if (!isNaN(parsed)) { return parsed; }