Calender Navigation #13

Merged
LucidKobold merged 15 commits from context into main 2021-12-01 15:34:58 -05:00
6 changed files with 138 additions and 54 deletions
Showing only changes of commit 68949175e7 - Show all commits

View File

@@ -37,8 +37,12 @@ const CalenderContextProvider = ({
// Selected month & year // Selected month & year
const [selectedMonth, setSelectedMonth] = useState<Date>(today); const [selectedMonth, setSelectedMonth] = useState<Date>(today);
const [endOfSelectedMonth, SetEndOfSelectedDMonth] = useState<Date>(endOfMonth(selectedMonth)); const [endOfSelectedMonth, SetEndOfSelectedDMonth] = useState<Date>(
const [lastDayOfSelectedMonth, setLastDayOfSelectedMonth] = useState<number>(getDate(endOfSelectedMonth)); endOfMonth(selectedMonth)
);
const [lastDayOfSelectedMonth, setLastDayOfSelectedMonth] = useState<number>(
getDate(endOfSelectedMonth)
);
const [daysOfMonth, setDaysOfMonth] = useState<[number] | [null]>([null]); const [daysOfMonth, setDaysOfMonth] = useState<[number] | [null]>([null]);
@@ -87,16 +91,14 @@ const CalenderContextProvider = ({
//TODO: Create an object of arrays that will align with the days on the week. Make two sets for each start of the week setting. //TODO: Create an object of arrays that will align with the days on the week. Make two sets for each start of the week setting.
// Navigation // Navigation
const prevMonth = (): void => { const prevMonth = (): void => {};
}
const calenderContextValues = { const calenderContextValues = {
today, today,
selectedMonth, selectedMonth,
daysOfMonth, daysOfMonth,
daysOfWeek, daysOfWeek,
prevMonth prevMonth,
}; };
return ( return (