Removed the state for today's date. Set the initial selected month to today's date.
This commit is contained in:
@@ -33,11 +33,8 @@ const CalenderContextProvider = ({
|
||||
}: {
|
||||
children: ReactNode;
|
||||
}): JSX.Element => {
|
||||
// Today's date
|
||||
const [today] = useState<Date>(new Date());
|
||||
|
||||
// Selected month & year
|
||||
const [selectedMonth, setSelectedMonth] = useState<Date>(today);
|
||||
const [selectedMonth, setSelectedMonth] = useState<Date>(new Date());
|
||||
const [endOfSelectedMonth, SetEndOfSelectedDMonth] = useState<number>(
|
||||
getDate(endOfMonth(selectedMonth))
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user