feat: disable button in RoomCard based on start time and refine date comparison in RoomTable

This commit is contained in:
Rémi 2025-01-04 18:53:51 +01:00
parent 38fa50e0c8
commit ddd333e64a
2 changed files with 6 additions and 2 deletions

View File

@ -70,7 +70,11 @@ export const RoomCard = ({ id, name, date, Times, Presentator }: Room) => {
{moment(date).dayOfYear() === moment().dayOfYear() && (
<div className="flex p-2">
<Button
className={""}
isDisabled={
moment(moment(Times[0].startTime).subtract(5, "minutes")).isAfter(
moment(),
)
}
color="primary"
radius="full"
size="sm"

View File

@ -36,7 +36,7 @@ export const RoomTable = () => {
moment(room.date).isSame(moment(), "day"),
);
const past = classes.data.filter((room) =>
moment(room.date).isBefore(moment()),
moment(room.date).isBefore(moment(), "day"),
);
setRooms({ future, actual, past });
});