(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.
This commit is contained in:
Viktor Lofgren 2024-01-13 13:04:42 +01:00
parent 2fefd0e4e3
commit 71e32c57d9

View File

@ -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());
}