diff --git a/src/components/Calendar/Calendar.js b/src/components/Calendar/Calendar.js index 7677e21b..1e4dbf20 100644 --- a/src/components/Calendar/Calendar.js +++ b/src/components/Calendar/Calendar.js @@ -17,7 +17,7 @@ const getDateParamString = ({ paramName, value }) => { return value ? `${paramName}=${value}` : '' } -const Calendar = () => { +const Calendar = ({ onSelect }) => { const dispatch = useDispatch() const candidateForCalendar = useSelector(selectCurrentCandidate) const role = useSelector(getRole) @@ -28,22 +28,22 @@ const Calendar = () => { const history = useHistory() - useEffect(() => { - fetchReportList({ - link: `${ - process.env.REACT_APP_API_URL - }/api/reports/index?user_id=${userId}${getDateParamString({ - paramName: 'fromDate', - value: fromDate - })}${getDateParamString({ - paramName: 'toDate', - value: toDate - })}`, - history, - role, - logout: () => dispatch(auth(false)) - }) - }, []) + // useEffect(() => { + // fetchReportList({ + // link: `${ + // process.env.REACT_APP_API_URL + // }/api/reports/index?user_id=${userId}${getDateParamString({ + // paramName: 'fromDate', + // value: fromDate + // })}${getDateParamString({ + // paramName: 'toDate', + // value: toDate + // })}`, + // history, + // role, + // logout: () => {} + // }) + // }, []) useEffect(() => { setMonth(currentMonth) @@ -78,7 +78,7 @@ const Calendar = () => {
{month} : 60 часов
diff --git a/src/components/Calendar/CalendarComponent.js b/src/components/Calendar/CalendarComponent.js index 24a26e8d..ddf41a3a 100644 --- a/src/components/Calendar/CalendarComponent.js +++ b/src/components/Calendar/CalendarComponent.js @@ -4,11 +4,11 @@ import rectangle from '../../images/rectangle__calendar.png' import calendarIcon from '../../images/calendar_icon.png' import moment from 'moment' import 'moment/locale/ru' -import { calendarHelper, currentMonthAndDay } from './calendarHelper' +import { calendarHelper, currentMonthAndDay, } from './calendarHelper' import './calendarComponent.scss' -const CalendarComponent = () => { +const CalendarComponent = ({ onSelect }) => { const [value, setValue] = useState(moment()) const [calendar, setCalendar] = useState([]) @@ -36,14 +36,7 @@ const CalendarComponent = () => { } function nextMonth() { - 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 value.clone().add(1, 'month'); } return ( @@ -52,11 +45,11 @@ const CalendarComponent = () => {