DayCellCollecter

Configs

2
eventFilter: function | String

A function, or the name of a function in the ownership hierarchy to filter which events are collected into the day cell data blocks. Return true to include the passed event, or a falsy value to exclude the event.

ParameterTypeDescription
eventEventModel

the passed event

Returns: Boolean

Set to true to stack multi-day events within each cell in the order of their start time.

When this property is set, multi day events will not sort to the top of day cells and flow in the same row from cell to cell.

Rather, the bar in the start cell will be sorted by its start time. In future cells, its bar will be sorted to the top of the cell.

Properties

3

Class hierarchy

isDayCellCollecter: Boolean= truereadonly
Identifies an object as an instance of DayCellCollecter class, or subclass thereof.
isDayCellCollecter: Boolean= truereadonlystatic
Identifies an object as an instance of DayCellCollecter class, or subclass thereof.

Other

Set to true to stack multi-day events within each cell in the order of their start time.

When this property is set, multi day events will not sort to the top of day cells and flow in the same row from cell to cell.

Rather, the bar in the start cell will be sorted by its start time. In future cells, its bar will be sorted to the top of the cell.

Events

3

Fired when a new set of events has been gathered for this view's date range.

// Adding a listener using the "on" method
dayCellCollecter.on('cellMapPopulated', ({ cellMap }) => {

});
ParameterTypeDescription
cellMapMap

The map of date keys to day cell data blocks.

Fired after one day cell's events are collected in sorted order according to the eventSorter

An application may use this to intervene in the event load received by the UI by mutating the events array.

// Adding a listener using the "on" method
dayCellCollecter.on('dayCellPopulated', ({ events, The }) => {

});
ParameterTypeDescription
eventsEventModel[]

The events to be shown for the passed date

TheDate

date the events are to be shown in.

Fires when a day spanning event is found, and the date to which its encapsulating event bar extends has been calculated.

The default result in the event's propagateEndDate property may be mutated by a listener.

Note that this is an ending point in time, it does not refer to a 24 hour block. So setting the propagateEndDate to new Date(2022, 1, 10) means that the event bar will occupy cells up to and including February 9 2022 and no further.

This is relayed through the owning Calendar, so a single listener may be used, for example:

new Calendar({
    listeners : {
        eventPropagate(eventData) {
            // If the event only spills into the next day but not further
            // then we do not want an extended event bar.
            // An arrow will indicate that it continues rightwards.
            if (eventData.eventEndDate < DateHelper.add(eventData.date, 2, 'd')) {
                eventData.propagateEndDate = DateHelper.add(DateHelper.clearTime(eventData.eventRecord.startDate), 1, 'd');
            }
        }
    }
})

The eventEndDate in the data block may also be changed to override the event's real end date. This will mean that there will be no arrow indicating that the event continues:

new Calendar({
    listeners : {
        eventPropagate(eventData) {
            // If the event spills into the next day but not further
            // then we do not want an extended event bar.
            // Because we override the eventEndDate, no arrow will be present
            // to indicate any continuation.
            if (eventData.eventEndDate < DateHelper.add(eventData.date, 2, 'd')) {
                eventData.propagateEndDate = eventData.eventEndDate = DateHelper.add(DateHelper.clearTime(eventData.eventRecord.startDate), 1, 'd');
            }
        }
    }
});
// Adding a listener using the "on" method
dayCellCollecter.on('eventPropagate', ({ eventEndDate, propagateEndDate, isAllDay, isOverflow, overflows, eventRecord, date }) => {

});
ParameterTypeDescription
eventEndDateDate

The end date for which to calculate the propagate end date.

propagateEndDateDate

The system-calculated end point of the event bar.

isAllDayBoolean

true if the event is an all day event, or spans multiple days.

isOverflowBoolean

true if this is being called as part of further propagation.

overflowsBoolean

true if the event extends into future cells.

eventRecordEventModel

The event record being propagated.

dateDate

The date from which the event is being propagated.

Event handlers

3

Called when a new set of events has been gathered for this view's date range.

new DayCellCollecter({
    onCellMapPopulated({ cellMap }) {

    }
});
ParameterTypeDescription
cellMapMap

The map of date keys to day cell data blocks.

Called after one day cell's events are collected in sorted order according to the eventSorter

An application may use this to intervene in the event load received by the UI by mutating the events array.

new DayCellCollecter({
    onDayCellPopulated({ events, The }) {

    }
});
ParameterTypeDescription
eventsEventModel[]

The events to be shown for the passed date

TheDate

date the events are to be shown in.

Called when a day spanning event is found, and the date to which its encapsulating event bar extends has been calculated.

The default result in the event's propagateEndDate property may be mutated by a listener.

Note that this is an ending point in time, it does not refer to a 24 hour block. So setting the propagateEndDate to new Date(2022, 1, 10) means that the event bar will occupy cells up to and including February 9 2022 and no further.

This is relayed through the owning Calendar, so a single listener may be used, for example:

new Calendar({
    listeners : {
        eventPropagate(eventData) {
            // If the event only spills into the next day but not further
            // then we do not want an extended event bar.
            // An arrow will indicate that it continues rightwards.
            if (eventData.eventEndDate < DateHelper.add(eventData.date, 2, 'd')) {
                eventData.propagateEndDate = DateHelper.add(DateHelper.clearTime(eventData.eventRecord.startDate), 1, 'd');
            }
        }
    }
})

The eventEndDate in the data block may also be changed to override the event's real end date. This will mean that there will be no arrow indicating that the event continues:

new Calendar({
    listeners : {
        eventPropagate(eventData) {
            // If the event spills into the next day but not further
            // then we do not want an extended event bar.
            // Because we override the eventEndDate, no arrow will be present
            // to indicate any continuation.
            if (eventData.eventEndDate < DateHelper.add(eventData.date, 2, 'd')) {
                eventData.propagateEndDate = eventData.eventEndDate = DateHelper.add(DateHelper.clearTime(eventData.eventRecord.startDate), 1, 'd');
            }
        }
    }
});
new DayCellCollecter({
    onEventPropagate({ eventEndDate, propagateEndDate, isAllDay, isOverflow, overflows, eventRecord, date }) {

    }
});
ParameterTypeDescription
eventEndDateDate

The end date for which to calculate the propagate end date.

propagateEndDateDate

The system-calculated end point of the event bar.

isAllDayBoolean

true if the event is an all day event, or spans multiple days.

isOverflowBoolean

true if this is being called as part of further propagation.

overflowsBoolean

true if the event extends into future cells.

eventRecordEventModel

The event record being propagated.

dateDate

The date from which the event is being propagated.

Typedefs

2

A data block created by all DayCellCollecter Calendar views to encapsulate occupied day cells and the events which intersect with each date to be shown in the UI. All useful data about the date and the shape of the UI is included.

ParameterTypeDescription
viewCalendarView

The owning view of the cell.

dateDate

The date of the cell.

keyString

a YYYY-MM-DD formatted date key for the cell.

cellIndexNumber

The overall cell index in the cell-based UI being created.

dayNumber

The day of week for the cell: 0=Sunday, 6=Saturday

columnIndexNumber

The column index in the cell-based UI being created.

visibleColumnIndexNumber

The visible column index (eg 0 for a Monday if Sunday is the week start day, but was hidden)

isNonWorkingBoolean

true if the owning view considers the date a non-working day.

weekNumber[]

The [year, week] encapsulating the cell.

isOtherMonthBoolean

The cell is outside the view's primary time range. Only significant when used by a CalendarPanel which encapsulates a single month.

visibleBoolean

true if the date cell is not for a hidden day.

tomorrowDate

The date of the following cell.

isRowStartBoolean

true if the cell is at the start of a visible row.

isRowEndBoolean

true if the cell is at the end of a visible row.

hasOverflowBoolean

true if the renderedEvents overflow the cell height and require a +n more button.

eventsEventModel[]

The events which are to be shown for this date.

resourceResourceModel

Note this only exists when the cell is owned by a subview of a ResourceView, or while creating resource columns in a DayResourceView.

renderedEventsEventBar[]

If this view renders event bars (MonthView, CalendarRow), then this is an array of event bar definitions which belong in the cell. Whether all can be rendered depends upon the view's configured eventHeight and whether the cell is of fixed height. The hasOverflow property is set if the rendered events overflow a cell's fixed capacity.

resourceDayEventsEventModel[]

The events for the passed resource for the day (applies in a DayResourceCalendarRow) column

timeRangesTimeRangeModel[]

All time ranges which intersect with this date cell, including short ones which are rendered.

allDayTimeRangesTimeRangeModel[]

The all day time ranges which intersect with the whole day of this date cell.

A data block which describes how an event bar is to be rendered into a day cell.

ParameterTypeDescription
eventRecordEventModel

The event record for which the event bar is being rendered.

propagateEndDateDate

The date of the last cell into which the event bar will extend.

clsDomClassList

The CSS classes to apply to the event bar.

iconClsDomClassList

The CSS classes to apply to an event icon.

datasetObject

Property names and values to be applied to the Event bar's DOM dataset

eventColorString

Either a predefined colour name, or a DOM colour value to apply to the event bar.

isAllDayBoolean

true if the event is flagged as an all day event in its data, or if it spans a day boundary and occupies more than one cell.

isOverflowBoolean

true if this event bar is a continuation from a previous cell.

overflowsBoolean

true if this event bar flows into the next cell.

solidBarBoolean

true if the event bar is to be rendered with a solid background of its defined colour. All day events are solid by default.