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() && (
|
||||
<div className="flex p-2">
|
||||
<Button
|
||||
className={""}
|
||||
isDisabled={
|
||||
moment(moment(Times[0].startTime).subtract(5, "minutes")).isAfter(
|
||||
moment(),
|
||||
)
|
||||
}
|
||||
color="primary"
|
||||
radius="full"
|
||||
size="sm"
|
||||
|
@ -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 });
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user