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