From eecd94737779dfdc11dae81b969517a67bd61c68 Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Thu, 29 Jan 2026 09:26:21 +0100 Subject: [PATCH] Enhance date formatting in NobilityView: Update formatDate method to display time for today's or future dates, improving user experience by providing more relevant information. --- frontend/src/views/falukant/NobilityView.vue | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/frontend/src/views/falukant/NobilityView.vue b/frontend/src/views/falukant/NobilityView.vue index a83f00c..79ff74f 100644 --- a/frontend/src/views/falukant/NobilityView.vue +++ b/frontend/src/views/falukant/NobilityView.vue @@ -138,6 +138,21 @@ }, formatDate(isoString) { const d = new Date(isoString); + const now = new Date(); + const today = new Date(now.getFullYear(), now.getMonth(), now.getDate()); + const dateOnly = new Date(d.getFullYear(), d.getMonth(), d.getDate()); + + // Wenn das Datum heute ist oder in der Zukunft liegt, zeige auch die Uhrzeit + if (dateOnly.getTime() >= today.getTime()) { + return d.toLocaleString(navigator.language, { + year: 'numeric', + month: 'numeric', + day: 'numeric', + hour: '2-digit', + minute: '2-digit' + }); + } + // Ansonsten nur das Datum return d.toLocaleDateString(); } }