diff --git a/component/calender/index.tsx b/component/calender/index.tsx
index bb84b43..0d0c973 100644
--- a/component/calender/index.tsx
+++ b/component/calender/index.tsx
@@ -1,6 +1,7 @@
import React from "react";
-import { Box, SimpleGrid } from "@chakra-ui/react";
+import { Box, HStack, SimpleGrid, Text, VStack } from "@chakra-ui/react";
import { endOfMonth, getDate } from "date-fns";
+import CalenderNav from "./nav";
const Calender = (): JSX.Element => {
const today = new Date();
@@ -10,31 +11,95 @@ const Calender = (): JSX.Element => {
// console.info(`This month has ${lastDay} days.`);
- const daysArr = [];
- for (let i = daysArr.length; i < lastDay; i++) {
- daysArr.push(daysArr.length + 1);
+ const daysOfMonth = [];
+ for (let i = daysOfMonth.length; i < lastDay; i++) {
+ daysOfMonth.push(daysOfMonth.length + 1);
}
+
+ const daysOfWeek = {
+ Sunday: [
+ "Sunday",
+ "Monday",
+ "Tuesday",
+ "Wednesday",
+ "Thursday",
+ "Friday",
+ "Saturday",
+ ],
+ Monday: [
+ "Monday",
+ "Tuesday",
+ "Wednesday",
+ "Thursday",
+ "Friday",
+ "Saturday",
+ "Sunday",
+ ],
+ };
+
+ const userSettings = {
+ theme: "default",
+ startOfWeek: "Sunday",
+ };
+
return (
-
- {daysArr.map((day) => {
- return (
- {`Day ${day}`}
- );
- })}
-
+
+
+
+ {daysOfWeek[userSettings.startOfWeek].map((weekDay) => {
+ return (
+
+
+ {weekDay}
+
+
+ );
+ })}
+
+
+ {daysOfMonth.map((monthDay) => {
+ return (
+
+
+ {`Day ${monthDay}`}
+
+
+ );
+ })}
+
+
);
};
diff --git a/component/calender/nav.tsx b/component/calender/nav.tsx
new file mode 100644
index 0000000..b62504a
--- /dev/null
+++ b/component/calender/nav.tsx
@@ -0,0 +1,28 @@
+import React from "react";
+import { Heading, HStack, IconButton } from "@chakra-ui/react";
+import { Icon } from "@iconify/react";
+import { format } from "date-fns/esm";
+
+const CalenderNav = (): JSX.Element => {
+ const today = new Date();
+
+ const currentMonth = format(today, "LLLL uuuu");
+
+ return (
+
+ }
+ />
+
+ {currentMonth}
+
+ }
+ />
+
+ );
+};
+
+export default CalenderNav;