Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit 5515830

Browse files
vincit-matujoonatank
authored andcommitted
fix: show cancel button for ongoing (recurring) reservations
1 parent 77ea190 commit 5515830

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

apps/admin-ui/src/component/reservations/requested/RecurringReservationsView.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ function RecurringReservationsView({
7979
const forDisplay = reservations.map((x) => {
8080
const buttons = [];
8181
const startDate = new Date(x.begin);
82+
const endDate = new Date(x.end);
8283
const now = new Date();
8384

8485
if (x.state !== State.Denied) {
@@ -103,7 +104,7 @@ function RecurringReservationsView({
103104
/>
104105
);
105106
}
106-
if (startDate > now) {
107+
if (endDate <= now) {
107108
buttons.push(
108109
<ReservationListButton
109110
key="deny"
@@ -117,7 +118,7 @@ function RecurringReservationsView({
117118
return {
118119
date: startDate,
119120
startTime: format(startDate, "H:mm"),
120-
endTime: format(new Date(x.end), "H:mm"),
121+
endTime: format(endDate, "H:mm"),
121122
isRemoved: x.state === "DENIED",
122123
buttons,
123124
};

0 commit comments

Comments
 (0)