From 71e32c57d96474bedacc455cd2214d439338b56e Mon Sep 17 00:00:00 2001 From: Viktor Lofgren Date: Sat, 13 Jan 2024 13:04:42 +0100 Subject: [PATCH] (control) Add better timestamps for the events and message queue views Adjust display precision based on distance into the past, full ms-accurate timestamps available via hover-action. --- .../nu/marginalia/control/sys/model/MessageQueueEntry.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/services-core/control-service/src/main/java/nu/marginalia/control/sys/model/MessageQueueEntry.java b/code/services-core/control-service/src/main/java/nu/marginalia/control/sys/model/MessageQueueEntry.java index b4158604..b63a614c 100644 --- a/code/services-core/control-service/src/main/java/nu/marginalia/control/sys/model/MessageQueueEntry.java +++ b/code/services-core/control-service/src/main/java/nu/marginalia/control/sys/model/MessageQueueEntry.java @@ -12,8 +12,8 @@ public record MessageQueueEntry ( String ownerInstanceFull, long ownerTick, String state, + String createdTimeFull, String updatedTimeFull, - String updatedTime, int ttl ) { @@ -36,10 +36,10 @@ public record MessageQueueEntry ( } public String getCreatedTime() { - String retDateBase = updatedTimeFull.replace('T', ' '); + String retDateBase = createdTimeFull.replace('T', ' '); // if another day, return date, hour and minute - if (!updatedTimeFull.startsWith(LocalDate.now().toString())) { + if (!createdTimeFull.startsWith(LocalDate.now().toString())) { // return hour minute and seconds return retDateBase.substring(0, "YYYY-MM-DDTHH:MM".length()); }