checking past meetings and such

This commit is contained in:
Arjun Patel
2022-01-19 17:39:19 -08:00
parent e6c06d86a7
commit 3ccefa1702
3 changed files with 57 additions and 6 deletions
+15
View File
@@ -26,6 +26,7 @@ import RoomCard from "../RoomCard";
import toast from "react-hot-toast";
import RoomTypeTag from "../RoomTypeTag";
import moment from "moment";
import { getTime } from "../../helpers/dateTime";
enum RoomTypeFilter {
team = "team",
@@ -185,6 +186,20 @@ export default function DashboardRoom() {
room.type == RoomType.scheduled && room.status == RoomStatus.empty
);
// sorting array of scheduled rooms
scheduled.sort(function (a, b) {
// Turn your strings into dates, and then subtract them
// to get a value that is either negative, positive, or zero.
if (!b.scheduledDateTime) {
return -1;
}
return (
getTime(a.scheduledDateTime.toDate()) -
getTime(b.scheduledDateTime.toDate())
);
});
return (
<>
<span className="flex flex-row justify-start">