add counter
This commit is contained in:
@ -5,7 +5,7 @@ import rectangle from '../../images/rectangle__calendar.png';
|
||||
import calendarIcon from '../../images/calendar_icon.png';
|
||||
import moment from 'moment';
|
||||
import 'moment/locale/ru';
|
||||
import calendarHelper from './calendarHelper';
|
||||
import { calendarHelper, currentMonthAndDay } from './calendarHelper';
|
||||
|
||||
const CalendarComponent = () => {
|
||||
const [value, setValue] = useState(moment());
|
||||
@ -30,10 +30,6 @@ const CalendarComponent = () => {
|
||||
return '';
|
||||
}
|
||||
|
||||
function currentMonth(day) {
|
||||
return day.format('D MMMM');
|
||||
}
|
||||
|
||||
function prevMonth() {
|
||||
return value.clone().subtract(1, 'month');
|
||||
}
|
||||
@ -82,7 +78,7 @@ const CalendarComponent = () => {
|
||||
id="btn"
|
||||
>
|
||||
<img className={style.calendarIcon} src={calendarIcon} alt="" />
|
||||
{currentMonth(day)}
|
||||
{currentMonthAndDay()}
|
||||
</button>
|
||||
))
|
||||
)}
|
||||
|
Reference in New Issue
Block a user