diff --git a/components/search/filterComponents.tsx b/components/search/filterComponents.tsx index 734cdab..2f72fd7 100644 --- a/components/search/filterComponents.tsx +++ b/components/search/filterComponents.tsx @@ -59,7 +59,7 @@ export const CustomFilterCheckbox = (props: FilterCheckboxProps) => { interface CalendarFilterProps { onStartChange: Dispatch>; - onEndChange: Dispatch>; + onEndChange: Dispatch>; defaultStart: string | undefined; defaultEnd: string | undefined; } diff --git a/components/search/filters.tsx b/components/search/filters.tsx index d12b246..6a3f32e 100644 --- a/components/search/filters.tsx +++ b/components/search/filters.tsx @@ -14,7 +14,7 @@ interface SearchFilterProps { setEnrollment: Dispatch>; setAvailable: Dispatch>; setStart: Dispatch>; - setEnd: Dispatch>; + setEnd: Dispatch>; setInstitution: Dispatch>; setMin: Dispatch>; setMax: Dispatch>; diff --git a/components/search/search.tsx b/components/search/search.tsx index 36da50f..5f675fc 100644 --- a/components/search/search.tsx +++ b/components/search/search.tsx @@ -70,8 +70,14 @@ const Search = () => { const [format, setFormat] = useState([true, true]); const [enrollment, setEnrollment] = useState([true]); const [available, setAvailable] = useState([true]); - const [start, setStart] = useState(new Date().toLocaleDateString("en-CA")); - const [end, setEnd] = useState(); + const [start, setStart] = useState(() => { + const today = new Date(); + const year = today.getFullYear(); + const month = (today.getMonth() + 1).toString().padStart(2, "0"); + const day = today.getDate().toString().padStart(2, "0"); + return `${year}-${month}-${day}`; + }); + const [end, setEnd] = useState(""); const [institution, setInstitution] = useState("Any Institution"); const [min, setMin] = useState(0); const [max, setMax] = useState(20);