Skip to content

Commit

Permalink
feat: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
HereEast committed Oct 6, 2024
1 parent 778dc93 commit 1e16957
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 19 deletions.
10 changes: 3 additions & 7 deletions client/src/context/appContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,11 @@ export const AppContext = createContext<AppContextProps | undefined>(undefined);
export function AppContextProvider({ children }: AppContextProviderProps) {
const today = new Date();

const currentDay = today.getDate();
const currentMonth = today.getMonth() + 1;
const currentYear = today.getFullYear();

const value = {
today: {
day: currentDay,
month: currentMonth,
year: currentYear,
day: today.getDate(),
month: today.getMonth() + 1,
year: today.getFullYear(),
},
};

Expand Down
12 changes: 0 additions & 12 deletions client/src/context/monthContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ interface MonthContextProps {
setSelectedEntryId: (entry: MongooseId | null) => void;
selectedRating: Status | null;
setSelectedRating: (status: Status | null) => void;
today: {
todayDay: number;
todayMonth: number;
todayYear: number;
};
}

interface MonthContextProviderProps {
Expand All @@ -31,18 +26,11 @@ export function MonthContextProvider({ children }: MonthContextProviderProps) {
);
const [selectedRating, setSelectedRating] = useState<Status | null>(null);

const today = new Date();

const value = {
selectedEntryId,
setSelectedEntryId,
selectedRating,
setSelectedRating,
today: {
todayDay: today.getDate(),
todayMonth: today.getMonth() + 1,
todayYear: today.getFullYear(),
},
};

return (
Expand Down

0 comments on commit 1e16957

Please sign in to comment.