feat: disable button in RoomCard based on start time and refine date comparison in RoomTable
This commit is contained in:
parent
38fa50e0c8
commit
ddd333e64a
@ -70,7 +70,11 @@ export const RoomCard = ({ id, name, date, Times, Presentator }: Room) => {
|
|||||||
{moment(date).dayOfYear() === moment().dayOfYear() && (
|
{moment(date).dayOfYear() === moment().dayOfYear() && (
|
||||||
<div className="flex p-2">
|
<div className="flex p-2">
|
||||||
<Button
|
<Button
|
||||||
className={""}
|
isDisabled={
|
||||||
|
moment(moment(Times[0].startTime).subtract(5, "minutes")).isAfter(
|
||||||
|
moment(),
|
||||||
|
)
|
||||||
|
}
|
||||||
color="primary"
|
color="primary"
|
||||||
radius="full"
|
radius="full"
|
||||||
size="sm"
|
size="sm"
|
||||||
|
@ -36,7 +36,7 @@ export const RoomTable = () => {
|
|||||||
moment(room.date).isSame(moment(), "day"),
|
moment(room.date).isSame(moment(), "day"),
|
||||||
);
|
);
|
||||||
const past = classes.data.filter((room) =>
|
const past = classes.data.filter((room) =>
|
||||||
moment(room.date).isBefore(moment()),
|
moment(room.date).isBefore(moment(), "day"),
|
||||||
);
|
);
|
||||||
setRooms({ future, actual, past });
|
setRooms({ future, actual, past });
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user