diff --git a/frontend/src/pages/Bookability.tsx b/frontend/src/pages/Bookability.tsx
index 396d4f1..9b7a83e 100644
--- a/frontend/src/pages/Bookability.tsx
+++ b/frontend/src/pages/Bookability.tsx
@@ -77,6 +77,9 @@ const isWeekend = (dateStr: string): boolean => {
return day === 0 || day === 6
}
+const todayStr = fmtDate(new Date())
+const isPast = (dateStr: string): boolean => dateStr < todayStr
+
const formatCurrency = (value: number | null): string => {
if (value === null || value === undefined) return '-'
return new Intl.NumberFormat('en-GB', {
@@ -424,7 +427,8 @@ const Bookability: React.FC = () => {
styles.th,
styles.dateHeader,
styles.stickyHeader,
- isWeekend(dateStr) ? styles.weekendHeader : {}
+ isWeekend(dateStr) ? styles.weekendHeader : {},
+ isPast(dateStr) ? { opacity: 0.45 } : {}
)}
>
@@ -472,7 +476,7 @@ const Bookability: React.FC = () => {
({category.room_count} rooms)
{data.dates.map(dateStr => (
-
|
+ |
))}
{/* Occupancy row */}
@@ -491,7 +495,8 @@ const Bookability: React.FC = () => {
styles.td,
styles.occupancyCell,
isWeekend(dateStr) ? styles.weekendCell : {},
- { cursor: 'pointer' }
+ { cursor: 'pointer' },
+ isPast(dateStr) ? { opacity: 0.45 } : {}
)}
title="Click for history"
onClick={() => setHistory({ categoryId: category.category_id, categoryName: category.category_name, date: dateStr })}
@@ -521,7 +526,8 @@ const Bookability: React.FC = () => {
styles.occupancyCell,
isWeekend(dateStr) ? styles.weekendCell : {},
getOccStyle(),
- { cursor: 'pointer' }
+ { cursor: 'pointer' },
+ isPast(dateStr) ? { opacity: 0.45 } : {}
)}
title={`${occ.occupied} of ${bookableRooms} bookable rooms occupied${hasOffline ? ` (${occ.maintenance} offline)` : ''} - ${roomsLeft} left · click for history`}
onClick={() => setHistory({ categoryId: category.category_id, categoryName: category.category_name, date: dateStr })}
@@ -565,7 +571,8 @@ const Bookability: React.FC = () => {
styles.td,
styles.tariffCell,
isWeekend(dateStr) ? styles.weekendCell : {},
- noRoomsAvailable ? styles.cellNoRooms : styles.cellNoData
+ noRoomsAvailable ? styles.cellNoRooms : styles.cellNoData,
+ isPast(dateStr) ? { opacity: 0.45 } : {}
)}
title={noRoomsAvailable ? 'No rooms available · click for history' : 'Click for history'}
onClick={() => setHistory({ categoryId: category.category_id, categoryName: category.category_name, date: dateStr })}
@@ -604,7 +611,8 @@ const Bookability: React.FC = () => {
styles.tariffCell,
isWeekend(dateStr) ? styles.weekendCell : {},
getCellStyle(),
- !isEffectivelyAvailable && !noRoomsAvailable ? { textDecoration: 'line-through' } : {}
+ !isEffectivelyAvailable && !noRoomsAvailable ? { textDecoration: 'line-through' } : {},
+ isPast(dateStr) ? { opacity: 0.45 } : {}
)}
title={`${getTooltip()} · click for history`}
onClick={() => setHistory({ categoryId: category.category_id, categoryName: category.category_name, date: dateStr })}