Format resolution_date as YYYY-MM-DD in compliance table
Normalize the date in groupByHostname() to handle PostgreSQL Date objects, and add .slice(0,10) in the frontend render as a safety net. Prevents the full ISO timestamp (2026-05-15T00:00:00.000Z) from displaying in the table.
This commit is contained in:
@@ -238,7 +238,10 @@ function groupByHostname(rows, noteHostnames) {
|
||||
if ((row.seen_count || 1) > dev.seen_count) dev.seen_count = row.seen_count;
|
||||
if (row.first_seen && (!dev.first_seen || row.first_seen < dev.first_seen)) dev.first_seen = row.first_seen;
|
||||
if (row.last_seen && (!dev.last_seen || row.last_seen > dev.last_seen)) dev.last_seen = row.last_seen;
|
||||
if (row.resolution_date && !dev.resolution_date) dev.resolution_date = row.resolution_date;
|
||||
if (row.resolution_date && !dev.resolution_date) {
|
||||
const rd = row.resolution_date;
|
||||
dev.resolution_date = typeof rd === 'string' ? rd.slice(0, 10) : (rd instanceof Date ? rd.toISOString().slice(0, 10) : rd);
|
||||
}
|
||||
if (row.remediation_plan && !dev.remediation_plan) dev.remediation_plan = row.remediation_plan;
|
||||
}
|
||||
return Object.values(deviceMap).map(({ _seenMetricIds, ...dev }) => dev);
|
||||
|
||||
Reference in New Issue
Block a user