From b0ca345dbb8cf900867b92d771567428737306ac Mon Sep 17 00:00:00 2001 From: Hope87 Date: Wed, 23 Jun 2021 13:17:59 +0300 Subject: [PATCH] fixed calendar page --- src/components/Calendar/CalendarComponent.js | 13 ++++++++++--- src/components/Home/Home.js | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/components/Calendar/CalendarComponent.js b/src/components/Calendar/CalendarComponent.js index e1110887..49d7314e 100644 --- a/src/components/Calendar/CalendarComponent.js +++ b/src/components/Calendar/CalendarComponent.js @@ -35,20 +35,27 @@ const CalendarComponent = () => { } function nextMonth() { - return value.clone().add(1, 'month'); + return value.clone().subtract(2, 'month'); } + const prevMonthFirst = () => { + return moment().subtract(1, 'month').format('MMMM'); + }; + const prevMonthSecond = () => { + return moment().subtract(2, 'month').format('MMMM'); + }; + return (

Мои отчеты

- setValue(prevMonth())}>Май + setValue(prevMonth())}>{prevMonthFirst()}
- setValue(nextMonth())}>Апрель + setValue(nextMonth())}>{prevMonthSecond()}
diff --git a/src/components/Home/Home.js b/src/components/Home/Home.js index 608caaec..40bec508 100644 --- a/src/components/Home/Home.js +++ b/src/components/Home/Home.js @@ -51,7 +51,7 @@ const tabsList = [ }, ]; -const Home = ({ onTestFunc }) => { +const Home = () => { const [tabs, setTabs] = useState([]); const [candidates, setCandidates] = useState([]); const [tags, setTags] = useState([]);