fix(studio): always include year in non-today audit timestamps (v0.14.2)

Previous patch dropped the year for current-year events,
showing `05-04 21:25:39` — locale-ambiguous (US reads May 4,
EU reads 5 April). Operators should not have to guess. Now
every non-today timestamp renders as `YYYY-MM-DD HH:mm:ss`;
same-day events keep the compact `HH:mm:ss`.

Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
flemming-it 2026-05-07 17:06:21 +02:00
parent 1e0bd0b51b
commit 6e3c6df200
3 changed files with 5 additions and 3 deletions

View file

@ -143,9 +143,11 @@ class _AuditPageState extends State<AuditPage> {
local.month == now.month &&
local.day == now.day;
if (sameDay) return time;
// Older events always carry the full ISO date. `MM-dd`
// alone is locale-ambiguous (US reads it as May-04, EU as
// 5 April) operators should not have to guess.
final mo = local.month.toString().padLeft(2, '0');
final dd = local.day.toString().padLeft(2, '0');
if (local.year == now.year) return '$mo-$dd $time';
return '${local.year}-$mo-$dd $time';
}