diff --git a/web/src/elements/notifications/NotificationDrawer.ts b/web/src/elements/notifications/NotificationDrawer.ts index f366ec440..8b8e77ae8 100644 --- a/web/src/elements/notifications/NotificationDrawer.ts +++ b/web/src/elements/notifications/NotificationDrawer.ts @@ -40,9 +40,7 @@ export class NotificationDrawer extends LitElement { } renderItem(item: Notification): TemplateResult { - const delta = Date.now() - (parseInt(item.created, 10) * 1000); - // TODO: more flexible display, minutes and seconds - const age = `${Math.round(delta / 1000 / 3600)} Hours ago`; + const created = new Date(parseInt(item.created, 10) * 1000); let level = ""; switch (item.severity) { case "notice": @@ -76,7 +74,7 @@ export class NotificationDrawer extends LitElement {

${item.body}

- ${age} + ${created.toLocaleString()} `; }