From e91f8f2a4b914ad26f7655daad4847e5525ee191 Mon Sep 17 00:00:00 2001 From: Jeppe Bundgaard Date: Thu, 27 Nov 2025 12:07:58 +0100 Subject: [PATCH] "Add filters and mobile-friendly toggles to OrderBookingsTable; enhance date labels with relative terms and provide 'Show all bookings' button when filters are applied." --- .../displays/tables/OrderBookingsTable.vue | 99 ++++++++++++++++++- 1 file changed, 97 insertions(+), 2 deletions(-) diff --git a/src/views/dashboards/userDashboard/bookings/displays/tables/OrderBookingsTable.vue b/src/views/dashboards/userDashboard/bookings/displays/tables/OrderBookingsTable.vue index f0949ad0..f3594ffa 100644 --- a/src/views/dashboards/userDashboard/bookings/displays/tables/OrderBookingsTable.vue +++ b/src/views/dashboards/userDashboard/bookings/displays/tables/OrderBookingsTable.vue @@ -281,6 +281,12 @@ const switchOnlyPending = (event) => { onOrderIdFilterChange({ target: { value: event.target.checked ? 'is null' : '*' } }); } +const switchOnlyPendingAndOnlyToday = (event) => { + onOnlyTodayFilterChange({ target: { value: event.target.checked ? new Date().toISOString().split('T')[0] : '*' } }, false); + onOrderIdFilterChange({ target: { value: event.target.checked ? 'is null' : '*' } }, false); + loadList(); +} + const isFilterApplied = () => { if (!router.currentRoute.value.path.startsWith('/admin')) { if (departmentFilter.value !== '*') { @@ -408,7 +414,7 @@ const resetVersionToNew = () => {
- +
@@ -639,6 +645,20 @@ const resetVersionToNew = () => {
+ + +
+ +
+ + +
+
+ +
+ +
+ + +
+
@@ -696,7 +757,31 @@ const resetVersionToNew = () => {

- {{ new Date(booking.datetime).toLocaleDateString('da-DK', { year: 'numeric', month: 'long', day: 'numeric' }) }} + + {{ + (() => { + const bookingDate = new Date(booking.datetime); + const today = new Date(); + const yesterday = new Date(); + yesterday.setDate(today.getDate() - 1); + if (bookingDate.toDateString() === today.toDateString()) { + return 'I dag'; + } else if (bookingDate.toDateString() === yesterday.toDateString()) { + return 'I går'; + } else { + return bookingDate.toLocaleDateString('da-DK', { year: 'numeric', month: 'long', day: 'numeric' }); + } + })() + }} + • + {{ sortedList.filter((b) => { + const bDate = new Date(b.datetime); + const bookingDate = new Date(booking.datetime); + return bDate.getFullYear() === bookingDate.getFullYear() && + bDate.getMonth() === bookingDate.getMonth() && + bDate.getDate() === bookingDate.getDate(); + }).length }} {{SessionUser.objects.order_bookings.meta.labels.multiple.toLowerCase()}} +
@@ -797,6 +882,16 @@ const resetVersionToNew = () => {
+ +
+
+ +
+