From 8a56c6a9f9042a10e5cae178edf2ea68c087585a Mon Sep 17 00:00:00 2001 From: Graeme Ainsworth Date: Wed, 27 Apr 2022 21:44:57 +1200 Subject: [PATCH 1/2] Add ViewMode Year --- example/src/App.tsx | 4 +- example/src/components/view-switcher.tsx | 7 +++- src/components/calendar/calendar.tsx | 53 ++++++++++++++++++++++-- src/helpers/date-helper.ts | 9 ++++ src/types/public-types.ts | 1 + 5 files changed, 69 insertions(+), 5 deletions(-) diff --git a/example/src/App.tsx b/example/src/App.tsx index b1115f2..c4faaaf 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -10,7 +10,9 @@ const App = () => { const [tasks, setTasks] = React.useState(initTasks()); const [isChecked, setIsChecked] = React.useState(true); let columnWidth = 65; - if (view === ViewMode.Month) { + if (view === ViewMode.Year) { + columnWidth = 350; + } else if (view === ViewMode.Month) { columnWidth = 300; } else if (view === ViewMode.Week) { columnWidth = 250; diff --git a/example/src/components/view-switcher.tsx b/example/src/components/view-switcher.tsx index cac872c..2f98e6e 100644 --- a/example/src/components/view-switcher.tsx +++ b/example/src/components/view-switcher.tsx @@ -46,7 +46,12 @@ export const ViewSwitcher: React.SFC = ({ > Month - +