Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion web/src/components/MyBookings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ const MyBookings = () => {
<li key={booking.booking_id}>
Desk: <strong>{booking.desk_name || booking.desk_id}</strong>{" "}
<br />
Date: {new Date(booking.from_date).toLocaleDateString()} <br />
Date: {new Date(booking.from_date).toLocaleDateString(
"en-GB",
)}{" "}
<br />
{tab === "upcoming" && (
<button onClick={() => openModal(booking)}>
Cancel Booking
Expand Down
19 changes: 19 additions & 0 deletions web/src/pages/CalendarView.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,25 @@
.calendar-table th {
background-color: #f0f0f0;
color: #333;
min-width: 120px;
}

.day-header {
display: flex;
flex-direction: column;
align-items: center;
gap: 0.25rem;
}

.day-name {
font-weight: bold;
font-size: 0.9rem;
color: #666;
}

.day-date {
font-size: 0.8rem;
color: #333;
}

.calendar-table .booked {
Expand Down
13 changes: 11 additions & 2 deletions web/src/pages/CalendarView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,24 @@ const CalendarView = () => {
<div className="calendar-view">
<div className="calendar-header">
<button onClick={handlePrevWeek}>&lt; Prev Week</button>
<h2>Week of {weekDays[0].toLocaleDateString()}</h2>
<h2>Week of {weekDays[0].toLocaleDateString("en-GB")}</h2>
<button onClick={handleNextWeek}>Next Week &gt;</button>
</div>
<table className="calendar-table">
<thead>
<tr>
<th>Desk</th>
{weekDays.map((day) => (
<th key={day.toISOString()}>{day.toLocaleDateString()}</th>
<th key={day.toISOString()}>
<div className="day-header">
<div className="day-name">
{day.toLocaleDateString("en-GB", { weekday: "short" })}
</div>
<div className="day-date">
{day.toLocaleDateString("en-GB")}
</div>
</div>
</th>
))}
</tr>
</thead>
Expand Down
6 changes: 3 additions & 3 deletions web/src/pages/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ const Home = () => {

const formatDate = (dateString) => {
const date = new Date(dateString);
return date.toLocaleDateString("en-US", {
return date.toLocaleDateString("en-GB", {
weekday: "long",
year: "numeric",
month: "long",
Expand All @@ -137,15 +137,15 @@ const Home = () => {

<div className="date-navigation">
<button onClick={goToPreviousDay} className="nav-button">
Previous
{"<"} Previous
</button>

<div className="date-display">
<h3>{formatDate(selectedDate)}</h3>
</div>

<button onClick={goToNextDay} className="nav-button">
Next
Next {">"}
</button>
</div>

Expand Down
Loading