Calender Navigation #13

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

View File

@@ -11,18 +11,20 @@ type days =
| "Friday"
| "Saturday";
interface DaysOfWeek {
startOfWeek: {
Sunday: days[];
Monday: days[];
};
}
interface CalenderContextState {
today: Date;
selectedMonth: Date;
endOfCurrMonth: Date;
lastDay: number;
daysOfMonth: [number] | [null];
daysOfWeek: {
startOfWeek: {
Sunday: [days];
Monday: [days];
};
};
daysOfWeek: DaysOfWeek;
prevMonth: () => void;
nextMonth: () => void;
}
const CalenderContext = createContext({} as CalenderContextState);
@@ -77,7 +79,7 @@ const CalenderContextProvider = ({
}, [selectedMonth]);
// Calender Layout
const daysOfWeek = {
const daysOfWeek: DaysOfWeek = {
startOfWeek: {
Sunday: [
"Sunday",
@@ -125,6 +127,7 @@ const CalenderContextProvider = ({
daysOfMonth,
daysOfWeek,
prevMonth,
nextMonth,
};
return (