I’m using Fullcalendar.io with React and I’m interested in displaying only the Week view (not a custom special one, just the default week view). Is there a way to do it without creating a custom view?
1
First of all not sufficient Data is given you should include the Work you’ve tried from your Side.
I Searched and found a code but you need timeGridPlugin from fullcalendar/timegrid library and check the below code I’m new to react dev so,
check if you can modify code anywhere
Code:
import { Calendar } from '@fullcalendar/core';
import timeGridPlugin from '@fullcalendar/timegrid';
const MyCalendar = () => (
<div>
<FullCalendar
plugins={[timeGridPlugin]}
views={["timeGridWeek"]} // this line adjusts calendar to only week View
/>
</div>
);
I saw that Fullcalendar allows for a “headerToolbar” field, in which “timeGridWeek” can be set in order that it is the only available view. That fused with the other answers here gives this:
<FullCalendar
initialView={timeGridWeek}
headerToolbar={
center: "timeGridWeek",
}
plugins={[timeGridPlugin]}
/>