Answer the question
In order to leave comments, you need to log in
Wrong display of dates in react-big-calendar, why?
Import calendar and moment.js:
import { Calendar, momentLocalizer } from "react-big-calendar";
import moment from "moment";
const localizer = momentLocalizer(moment);
const events = [
{
title: "1",
start: moment().toDate(),
end: moment().add(1, "days").toDate()
},
{
title: "2",
start: moment().add(1, "days").toDate(),
end: moment().add(2, "days").toDate()
},
{
title: "3",
start: moment().add(2, "days").toDate(),
end: moment().add(3, "days").toDate()
},
];
console.log(events);
return <Calendar localizer={localizer} events={events} views={["month"]} />;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question