diff --git a/booking-app/components/src/client/routes/components/bookingTable/BookingTableFilters.tsx b/booking-app/components/src/client/routes/components/bookingTable/BookingTableFilters.tsx index b2d89e0..0b809a2 100644 --- a/booking-app/components/src/client/routes/components/bookingTable/BookingTableFilters.tsx +++ b/booking-app/components/src/client/routes/components/bookingTable/BookingTableFilters.tsx @@ -50,7 +50,7 @@ export default function BookingTableFilters({ handleDateRangeFilterClick(null, x)} - options={["Today", "This Week", "All Future", "Past 24 hours", "Past Week", "Past Month", "Past 6 Months", "All Past"]} + options={["Today", "This Week", "All Future", "Past 24 hours", "Past Week", "Past Month", "Past 6 Months", "Past 9 Months"]} placeholder={"Today"} sx={{ width: "125px", mr: 1 }} /> diff --git a/booking-app/components/src/client/routes/components/bookingTable/Bookings.tsx b/booking-app/components/src/client/routes/components/bookingTable/Bookings.tsx index 3eb9469..c86cb6b 100644 --- a/booking-app/components/src/client/routes/components/bookingTable/Bookings.tsx +++ b/booking-app/components/src/client/routes/components/bookingTable/Bookings.tsx @@ -46,7 +46,6 @@ export const Bookings: React.FC = ({ const isUserView = pageContext === PageContextLevel.USER; useEffect(() => { - // reloadFutureBookings(); return ()=>{ setLastItem(null); } @@ -209,10 +208,10 @@ export const Bookings: React.FC = ({ closeModal={() => setModalData(null)} /> )} - {loadMoreEnabled && + {/* {loadMoreEnabled && ( - )} + )} */} ); }; diff --git a/booking-app/components/src/client/routes/components/bookingTable/hooks/getDateFilter.ts b/booking-app/components/src/client/routes/components/bookingTable/hooks/getDateFilter.ts index 2bcfd1b..957313e 100644 --- a/booking-app/components/src/client/routes/components/bookingTable/hooks/getDateFilter.ts +++ b/booking-app/components/src/client/routes/components/bookingTable/hooks/getDateFilter.ts @@ -1,6 +1,6 @@ import { Booking } from "@/components/src/types"; -export type DateRangeFilter = "Today" | "This Week" | "All Future" | "Past 24 hours" | "Past Week" | "Past Month" | "Past 6 Months" | "All Past"; +export type DateRangeFilter = "Today" | "This Week" | "All Future" | "Past 24 hours" | "Past Week" | "Past Month" | "Past 6 Months" | "Past 9 Months"; export const DATE_FILTERS: Record boolean> = { Today: (row) => { @@ -79,7 +79,7 @@ export const DATE_FILTERS: Record boolean> = { return diff >= 0 && diff < 6 * 30 * 24 * 60 * 60 * 1000; }, - "All Past": (row) => { + "Past 9 Months": (row) => { const today = new Date(); const date = row.startDate.toDate(); diff --git a/booking-app/components/src/client/routes/components/bookingTable/hooks/useBookingFilters.ts b/booking-app/components/src/client/routes/components/bookingTable/hooks/useBookingFilters.ts index 305c20d..864c402 100644 --- a/booking-app/components/src/client/routes/components/bookingTable/hooks/useBookingFilters.ts +++ b/booking-app/components/src/client/routes/components/bookingTable/hooks/useBookingFilters.ts @@ -94,12 +94,15 @@ function getDateRangeFromDateSelection(selectedDateRange: DateRangeFilter) { startOfPast6Months.setMonth(today.getMonth() - 6); return [startOfPast6Months, today]; } - case "All Past": { + case "Past 9 Months": { // return an array of the start of time and the end of today const today = new Date(); const endOfToday = new Date(today); endOfToday.setHours(23, 59, 59, 999); - return [null, endOfToday]; + + const startOfPast9Months = new Date(today); + startOfPast9Months.setMonth(today.getMonth() - 9); + return [startOfPast9Months, endOfToday]; } default: return "Today"; diff --git a/booking-app/lib/firebase/firebase.ts b/booking-app/lib/firebase/firebase.ts index 54e79fd..b3835cf 100644 --- a/booking-app/lib/firebase/firebase.ts +++ b/booking-app/lib/firebase/firebase.ts @@ -114,7 +114,7 @@ export const getPaginatedData = async ( ...queryParams, orderBy(filters.sortField, 'desc'), orderBy("__name__", 'desc'), - limit(itemsPerPage) + // limit(itemsPerPage) ); // If we have a last visible item, start after it @@ -125,8 +125,8 @@ export const getPaginatedData = async ( ...queryParams, orderBy(filters.sortField, 'desc'), orderBy("__name__", 'desc'), - startAfter(lastVisible[filters.sortField], lastVisible.id), - limit(itemsPerPage) + // startAfter(lastVisible[filters.sortField], lastVisible.id), + // limit(itemsPerPage) ); }