DayCellRenderer
Mixin
Mixin that provides the ability to render calendar day cells, including event bars, overflow indicators, and day-number headers. It handles the layout of event bars within each cell, managing slot allocation for multi-day events that span across cells, and rendering the "+N more" overflow button when events exceed the cell's visible capacity.
This is used by the MonthView and also CalendarRow. It expects its host class to include the CalendarMixin mixin.
Views that use this mixin support customizing day cell content and overflow behavior:
const calendar = new Calendar({
modes : {
month : {
// Customize the day cell content
dayCellRenderer(cellData, domConfig) {
if (cellData.day === 0 || cellData.day === 6) {
domConfig.className['is-weekend'] = true;
}
},
// Configure overflow popup behavior
overflowClickAction : 'popup',
overflowPopup : {
eventList : {
type : 'dayview'
}
}
}
}
});
Configs
Configs are options you supply in a configuration object when creating an instance of this class-
When we create the aria-label for a cell, we want to include the number of events in the cell. This is the localization key which will be used to format that string. By default, we announce "n events", but this can be overridden to announce "n all-day events" or whatever is appropriate for the view - see DayView#changeAllDayEvents.
-
How much vertical space in pixels to leave between event bars in a cell.
Has a corresponding runtime eventSpacing property.
Properties
Properties are getters/setters or publicly accessible variables on this class-
Identifies an object as an instance of DayCellRenderer class, or subclass thereof.
-
Yields a
Mapwhich contains the cell data for each date in the current view. This is aMapwhere the keys are the date strings in the formatYYYY-MM-DDand the values are DayCell objects which contain the data for that cell. -
How much vertical space in pixels to leave between event bars in a cell.
Has a corresponding eventSpacing config.
-
The OverflowPopup instance that this view may show when events for one day overflow the available space.
Has a corresponding overflowPopup config.
-
Identifies an object as an instance of DayCellRenderer class, or subclass thereof.