리액트 big calendar 에서 월/주/일 이동 버튼이 작동 안해서 수정
const Toolbar = ({ date, label, onNavigate, onView, view }) => {
return (
……..
//이전 월/주/일 로 이동
<img
src={left_icon}
alt="이전"
style={{ cursor: "pointer", width: 30, height: 30, marginRight: 10}}
onClick={() => {
const newDate = moment(date).subtract(1, view === "month" ? "month" : view === "week" ? "week" : "day").toDate();
onNavigate("date", newDate);
}}
/>
//다음 월/주/일 로 이동
<img
src={right_icon}
alt="다음"
style={{ cursor: "pointer", width: 30, height: 30, marginLeft: 10}}
onClick={() => {
const newDate = moment(date).add(1, view === "month" ? "month" : view === "week" ? "week" : "day").toDate();
onNavigate("date", newDate);
}}
/>
……..
)
export default Toolbar;
'React' 카테고리의 다른 글
| [ React ] big calendar 에서 onSelectSlot 동작 안하는 문제 (1) | 2025.08.12 |
|---|