The main plugin export that registers day grid view functionality with FullCalendar core. Provides predefined view configurations for different time spans and integrates with the FullCalendar plugin system.
Main plugin definition created via createPlugin() that registers day grid views and components.
/**
* Main day grid plugin for FullCalendar
* Contains view definitions and component registrations
*/
declare const plugin: PluginDef;
export default plugin;The plugin is created with the following configuration:
interface PluginConfig {
name: string;
initialView: string;
views: {
[viewName: string]: ViewSpec;
};
}The plugin automatically registers five view types with FullCalendar:
interface ViewSpecs {
dayGrid: {
component: typeof DayTableView;
dateProfileGeneratorClass: typeof TableDateProfileGenerator;
};
dayGridDay: {
type: 'dayGrid';
duration: { days: 1 };
};
dayGridWeek: {
type: 'dayGrid';
duration: { weeks: 1 };
};
dayGridMonth: {
type: 'dayGrid';
duration: { months: 1 };
fixedWeekCount: true;
};
dayGridYear: {
type: 'dayGrid';
duration: { years: 1 };
};
}Usage Examples:
import { Calendar } from '@fullcalendar/core';
import dayGridPlugin from '@fullcalendar/daygrid';
// Basic month view
const calendar = new Calendar(calendarEl, {
plugins: [dayGridPlugin],
initialView: 'dayGridMonth'
});
// Week view with custom options
const weekCalendar = new Calendar(calendarEl, {
plugins: [dayGridPlugin],
initialView: 'dayGridWeek',
dayMaxEvents: 3
});
// Year view for overview
const yearCalendar = new Calendar(calendarEl, {
plugins: [dayGridPlugin],
initialView: 'dayGridYear',
height: 600
});DayTableViewTableDateProfileGeneratortrue (always shows 6 weeks)The plugin integrates with FullCalendar's plugin system:
interface PluginDef {
name: string;
initialView?: string;
views?: { [viewName: string]: ViewSpec };
viewConfigs?: { [viewName: string]: ViewConfigHash };
cmdFormatter?: CmdFormatterFunc;
eventRefiners?: RefinersHash;
eventDefMutationAppliers?: EventDefMutationAppliers;
eventDragMutationMassagers?: EventDragMutationMassagers;
eventDefMemberAdders?: EventDefMemberAdders;
displayEventEnd?: boolean;
// ... additional plugin hooks
}The plugin automatically imports its stylesheet:
import './index.css';This provides default styling for:
Helper functions for creating and configuring the day grid plugin.
/**
* Builds day table render range with week snapping and fixed week options
* @param props - Configuration for range building including current range, snapping options
* @returns Date range adjusted for table rendering with proper week boundaries
*/
function buildDayTableRenderRange(props: {
currentRange: DateRange;
snapToWeek: boolean;
fixedWeekCount: boolean;
dateEnv: DateEnv;
}): DateRange;