From 8daaf22f20ace975f0594fc616ffb120bd093cf8 Mon Sep 17 00:00:00 2001 From: Lucid Kobold Date: Sun, 5 Dec 2021 22:18:45 -0600 Subject: [PATCH] Fixed hard coded date. Was causing erorrs. --- pages/index.tsx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/pages/index.tsx b/pages/index.tsx index 09bf91a..a0fe706 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -1,13 +1,25 @@ -import React from "react"; +import React, { useRef } from "react"; import { Box } from "@chakra-ui/react"; import Calender from "../components/calender"; import { CalenderContextProvider } from "../contexts/CalenderContext"; +import { format } from "date-fns"; + +interface UpdateCalendarProps { + year: number; + month: number; + day: number; +} const IndexPage = (): JSX.Element => { + const date = useRef({ + year: parseInt(format(new Date(), "y")), + month: parseInt(format(new Date(), "d")), + day: parseInt(format(new Date(), "L")), + }); return ( - + );