mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 12:32:43 +00:00
The legacy export emitted snake_case English headers and raw UTC timestamps which Excel/LibreOffice misread once the `Z` suffix was stripped (issue #167 territory) and forced admins to mentally map `actor_username` → "Marc" every time they triaged a row. The export now mirrors the on-screen column order — `timestamp → user → IP → location → provider → outcome` — with `action` + `details` appended so the full audit payload still rides along. Headers are translated through the active locale; timestamps go through `formatInUserTz(..., "iso-with-offset")` so they round-trip correctly in any spreadsheet; `toCSV` now treats `\r` as an escape trigger alongside `\n,"` so Windows-newline detail strings stay on their row. `buildAuditLogCsvRecords` and `auditLogCsvHeaderLabels` live in `_shared.tsx` so the column-order/escape contract is pinned by a pure unit test independent of the React render.