Skip to content

Commit

Permalink
ran prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
namanhboi committed Sep 28, 2024
1 parent 720fbc7 commit 103be4e
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions frontend/src/components/UserTables/RidesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ type RidesTableProps = {
hasButtons: boolean;
};


/**
* Summary: check if a driver is available on a certain day based on their availability property.
* @param driver
* Summary: check if a driver is available on a certain day based on their availability property.
* @param driver
* @param day : is a number from 0 to 6 representing 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'
* @returns whether driver is available on that day.
*/
Expand All @@ -33,25 +32,22 @@ const isAvailableOnDay = (driver: DriverType, day: number) => {
return false;
};


// You can add additional filters to filter our drivers to reassign here.
const driverFilters: ((driver: DriverType) => boolean)[] = [
// (driver: DriverType) => {
// return driver.firstName != 'Naoya';
// },
];


const checkAdditionalFilters = (driver: DriverType) => {
return driverFilters.every((fn) => fn(driver));
};


/**
* summary: checks if a driver is availble between startTime and endTime based on their availability property.
* @param driver
* @param startTime
* @param endTime
* @param driver
* @param startTime
* @param endTime
* @returns whether driver is available between these 2 times.
*/
const isAvailable = (driver: DriverType, startTime: Date, endTime: Date) => {
Expand All @@ -65,9 +61,7 @@ const isAvailable = (driver: DriverType, startTime: Date, endTime: Date) => {
const startDay = dayAsString[
startTimeDay
] as keyof typeof driver.availability;
const endDay = dayAsString[
endTimeDay
] as keyof typeof driver.availability;
const endDay = dayAsString[endTimeDay] as keyof typeof driver.availability;
const driverStartDayAvailibility = driver.availability[startDay]; // hh:mm even for h <10
const driverEndDayAvailibility = driver.availability[endDay];
return (
Expand Down Expand Up @@ -97,7 +91,6 @@ const RidesTable = ({ rides, hasButtons }: RidesTableProps) => {
const [reassign, setReassign] = useState(false);
const [deleteOpen, setDeleteOpen] = useState(-1);


const unscheduledColSizes = [0.5, 0.5, 0.8, 1, 1, 0.8, 1];
const unscheduledHeaders = [
'',
Expand Down

0 comments on commit 103be4e

Please sign in to comment.