DayView

This is normally used as a mode of a Calendar (as seen in the live demo below), but may be used standalone as a regular Widget.

A Panel which displays one or more columns of days with events for each day arranged in ascending time order in each column.

This view is not limited to showing a single day. The date and range or startDate and endDate may be configured to cover any range.

By default, a narrow band of whitespace is left on the inline-end side of day columns to allow the user to click or drag to create events. This gutter may be configured using the eventLayout's gutterWidth property as shown in the examples below.

Calendar day view
//<code-header>
fiddle.title = 'Calendar day view';
//</code-header>
const calendar = new Calendar({
    appendTo : targetElement,
    height   : 500,
    date     : new Date(2020, 8, 2),
    modes    : {
        day : {
            dayStartTime     : 6,
            dayEndTime       : 19,
            visibleStartTime : 6,
            allDayEvents     : {
                fullWeek : false
            }
        },
        week   : null,
        month  : null,
        year   : null,
        agenda : null
    },
    events : [
        { startDate : '2020-09-02T00:00', duration : 5, durationUnit : 'd', name : 'Boss vacation', eventColor : 'red' },
        { startDate : '2020-09-02T07:00', duration : 5, durationUnit : 'h', name : 'Walk the dog', eventColor : 'yellow' },
        { startDate : '2020-09-03T09:00', duration : 2, durationUnit : 'h', name : 'Buy masks', eventColor : 'orange' },
        { startDate : '2020-09-04T07:00', duration : 1, durationUnit : 'h', name : 'Zoom meeting', eventColor : 'deep-orange' },
        { startDate : '2020-09-05T09:00', duration : 1, durationUnit : 'h', name : 'Get a haircut', eventColor : 'gray' }
    ],
    tbar : {
        items : {
            showAllDayHeader : {
                type    : 'checkbox',
                label   : 'Show all day header',
                checked : true,
                onChange({ checked }) {
                    calendar.activeView.showAllDayHeader = checked;
                }
            },
            showFullWeek : {
                type    : 'checkbox',
                label   : 'Show week header',
                checked : false,
                onChange({ checked }) {
                    calendar.activeView.allDayEvents.fullWeek = checked;
                }
            }
        }
    },
    bbar : {
        items : {
            gutterWidth : {
                type                 : 'slider',
                label                : 'Gutter width',
                min                  : 5,
                max                  : 100,
                value                : 5,
                triggerChangeOnInput : true,
                onChange({ value }) {
                    calendar.activeView.eventLayout.gutterWidth = value;
                }
            }
        }
    }
});

As a standalone widget, it will lack the capabilities of the Calendar class, such as keyboard-based event to event navigation and drag/drop features. As seen in this demo:

Day view
//<code-header>
fiddle.title = 'Day view';
//</code-header>
const dayView = new DayView({
    appendTo         : targetElement,
    height           : 500,
    startDate        : new Date(2020, 8, 2),
    endDate          : new Date(2020, 8, 7),
    dayStartTime     : 6,
    dayEndTime       : 19,
    visibleStartTime : 6,
    events           : [
        { startDate : '2020-09-02T00:00', duration : 5, durationUnit : 'd', name : 'Boss vacation', eventColor : 'red' },
        { startDate : '2020-09-02T07:00', duration : 5, durationUnit : 'h', name : 'Walk the dog', eventColor : 'yellow' },
        { startDate : '2020-09-03T09:00', duration : 2, durationUnit : 'h', name : 'Buy masks', eventColor : 'orange' },
        { startDate : '2020-09-04T07:00', duration : 1, durationUnit : 'h', name : 'Zoom meeting', eventColor : 'deep-orange' },
        { startDate : '2020-09-05T09:00', duration : 1, durationUnit : 'h', name : 'Get a haircut', eventColor : 'gray' }
    ],
    bbar : {
        items : {
            showAllDayHeader : {
                type    : 'checkbox',
                label   : 'Show all day header',
                checked : true,
                onChange({ checked }) {
                    dayView.showAllDayHeader = checked;
                }
            },
            gutterWidth : {
                type                 : 'slider',
                label                : 'Gutter width',
                min                  : 5,
                max                  : 100,
                value                : 5,
                triggerChangeOnInput : true,
                onChange({ value }) {
                    dayView.eventLayout.gutterWidth = value;
                }
            }
        }
    }
});

When using range, setting the date snaps the view to the start of a range (for example '1 week') which encapsulates the requested date.

When the startDate is changed dynamically, the duration remains the same.

This view can be configured to scroll to the specific time on first render, which defaults to 7 AM. This behavior is controlled by the visibleStartTime config.

A WeekView is a subclass of this view which is tied to showing weeks as defined by the weekStartDay.

By default, the view scrolls vertically to 7am on first render. This can be configured using the visibleStartTime config.

Keyboard shortcuts when focused inside a DayView (or WeekView)

  • - Move to the previous day.
  • - Move to the next day.
  • + - Zoom in (Increase hourHeight by 2).
  • - - Zoom out (Decrease hourHeight by 2).

Multi day events.

All day events, and multi day events are displayed in a row at the top.

Intraday events are arranged in ascending time order down day columns from the dayStartTime to the dayEndTime.

The showAllDayHeader config option can be used to not show multi day events at the top, but have them wrap across multiple day columns.

The following configs which apply to the all day row are passed into the configuration of the allDayEvents widget:

Event rendering can be customized using the eventRenderer method.

Configs

190

Common

noMatchingDates: String | DomConfig= L{noMatchingDates}Also a property

Text or HTML, or a DomConfig block to display when all dates in the range have been filtered out.

listenersEvents

Other

An object or an array of button specifications which add clickable icon buttons to the rendered event blocks which contain the following properties.

For example, the calendar may be configured like this:

modes : {
    day : {
        actionButtons : {
            delete : {
                tooltip : 'Delete event',
                cls     : 'b-icon-trash',
                handler : 'up.onDeleteAction'
            }
        }
    }
},

onDeleteAction({ eventRecord }) {
    this.removeEvents([eventRecord]);
}

A CalendarRow widget containing the horizontal series of calendar cells with the day headers and any all-day, or day-spanning events which fall inside this view's time range.

Note that this component calculates its height depending on its eventHeight, defaultEventRowCount and autoHeight settings, therefore any configured height and flex values will be ignored.

    modes : {
        day : {
            // Do not show the whole week in the header for the one day view
            allDayEvents : {
                fullWeek : false
            }
        }
    }

By default, when mousewheel zooming out from overflowing the client height, it is not permitted to zoom further out so that the hours underflow the client height.

When zooming out, the view normally stops when the hours exactly fit the client height.

Configure this as true to allow mousewheel zooming out to cause the hours to underflow the client height.

columnHeaderRenderer: function | String

A function, or name of a function which is passed the DayCellWithEvents object which describes the events and details of the day.

This function must return either an HTML string, or a DomConfig object to create a column header for the passed date.

columnHeaderRenderer({ events }) {
    return `${events.length ? events.length : 'No'} Events`;
}
ParameterTypeDescription
cellDataDayCellWithEvents

A data block describing the date and the events for that date.

Returns: String | Object

Configure this property as true to show the day name and date headers in a more compact style.

When this is set, the day name and date are displayed side by side instead of on separate lines and with a smaller font size.

This applies the b-compact-header CSS class to this widget which may be styled as required.

coreHours: Object | function | StringAlso a property

An object containing two properties, start and end representing the start and end of core working hours.

This causes the non core hours to be covered by a themeable translucent grey mask in the time axis.

This may be configured to also mask the non core hours in the day part of the view by setting the overlayDay property.

{
    coreHours : {
        start      : 9,
        end        : 17,
        overlayDay : true
    }
}

If this is configured as an array of less than seven elements, it is taken to be describing multiple core hours blocks within one day, so it could be

{
    coreHours : [{
        start      : 8,
        end        : 12,
    }, {
        start      : 14,
        end        : 18
    }
}

This may also be a seven element array so as to have different core hours for each JavaScript day of the week (Meaning 0 for Sunday to 6 for Saturday). This causes only the hours in the day columns to be masked:

{
    coreHours : [{
        start : 10,
        end   : 15
    },{
        start : 9,
        end   : 17
    },{
        start : 9,
        end   : 17
    },{
        start : 9,
        end   : 17
    },{
        start : 9,
        end   : 17
    },{
        start : 9,
        end   : 17
    },{
        start : 10,
        end   : 15
    }]
}

This may also be a function to return calculated core hours for every date. This causes only the hours in the day columns to be masked:

{
    coreHours : function(date) {
        // Shorter core hours at weekends
        if (date.getDay() === 0 || date.getDay() === 6) {
            return {
                start : '10:00',
                end   : '15:00'
            };
        }
        // Pre-lunch and post-lunch working blocks in the week
        return [{
            start : '08:00',
            end   : '12:00'
        }, {
            start : '14:00',
            end   : '18:00'
        };
    }
}

This may also be a seven element array which contains separate core hours specification for each day of the week as returned from the Date class.

This may also be a function, which, when passed a Date, returns a core hours specification for that date.

In the simplest case an object containing two properties, start and end:

  • coreHours.start - The start hour or start time string HH:MM of the core working hours. Date or String value allowed.
  • coreHours.end - The end hour or start time string HH:MM of the core working hours. Date or String value allowed
  • coreHours.overlayDay - Set to true to have the greyed zone cover the day part of the view.

Only valid when this config is specified as a simple Object.

ParameterTypeDescription
dateDate

Date for hours calculation

Returns: Object[]
currentTimeIndicatorRenderer: function | String

A function, or name of a function which produces a DomConfig block to create the current time indicator which is displayed in a day column which represents the current date. It is the developer's responsibility to add CSS classes and the appropriate CSS rules to produce the desire appearance.

currentTimeIndicatorRenderer : function() {
    return {
        className : 'my-current-time',
        text      : 'NOW'
    };
}

The result is used to sync the DOM of the day column.

Returns: DomConfig -

An object which describes the DOM structure of the today indicator element.

By default, half hour, fifteen minute tick lines are rendered in a lower contrast colour than hour lines.

Configure this as true to instead render the minor tick lines as dashed lines at the same contrast level as the hour lines.

dateFilter: function | StringAlso a property

A callback function, or the name of a function in the ownership hierarchy which an application may provide to filter out day columns for individual dates.

ParameterTypeDescription
contextDayCell

Information about the day column to be created.

Returns: Boolean -

Return false to not display a column for the passed date.

dayCellRenderer: function | String

A function, or name of a function which is passed the DomConfig object which will be used to sync with a day column.

dayCellRenderer : function(domConfig, cellData) {
    if (this.isSpecialDate(cellData.date)) {
        domConfig.className['fa'] =
        domConfig.className['fa-birthday-cake'] = 1;
    }
    return domConfig;
}

The result is used to sync the DOM of the day column.

ParameterTypeDescription
domConfigDomConfig | Object

A DomConfig config object which is used to sync the day column element.

domConfig.classNameObject

An object who's truthy property names will be applied as class names.

domConfig.styleObject

A CSS style definition object.

domConfig.datasetObject

The DOM data properties to set.

childrenDomConfig[]

The DomConfig definitions for the events in the day.

cellDataDayCell

A DayCell object that contains data about the cell.

Returns: String
dayEndTime: String | Number= 24Also a property

Either the end hour of the day, or a 24 hour HH:MM string denoting the end date of the last rendered time block. You can also set this value to a ms timestamp representing time from midnight.

This config, along with dayStartTime determines which hours are displayed in a day column.

Note that this is only granular to the hour level. The value will be rounded up to the ending hour of the configured time.

dayHeaderRenderer: function | String

A function, or name of a function which is passed the DomConfig object which will be used to sync with a day cell header in the all day row.

dayHeaderRenderer : function(headerDomConfig, cellData) {
    if (this.isSpecialDate(cellData.date)) {
        headerDomConfig.className['b-is-special-date'] = 1;

        // Add to the content element's children
        headerDomConfig.children.push({
            text : 'Special day',
            className : 'b-special-day
        });
    }
}

The result is used to sync the DOM of the day column in the all day row.

ParameterTypeDescription
headerDomConfigDomConfig | Object

A DomConfig config object which is used to sync the day header element.

headerDomConfig.classNameObject

An object who's truthy property names will be applied as class names.

headerDomConfig.styleObject

A CSS style definition object.

headerDomConfig.datasetObject

The DOM data properties to set.

headerDomConfig.childrenDomConfig[]

The DomConfig definitions the header content. There will be 2 children encapsulating the day name and the date.

cellDataDayCell

A DayCell object that contains data about the cell.

Returns: String
dayNameFormat: String | function= 'ddd'

The DateHelper format string/function for day names in the header row (e.g., "ddd" for "Mon", "Tue", ...)

ParameterTypeDescription
dateDate

The date to format.

Returns: String -

The formatted date.

dayStartShift: String | Number= 0

Either the start hour of the day, or a 24 hour HH:MM string denoting the start time for days. This is midnight by default.

Setting this value to 12, for example, indicates that the 24 hour "day" runs from noon on one day, to noon on the following day. This causes events in this span of time to layout in the same day column. In this example, a two hour event that spanned midnight would be rendered in the same way a normal, 2 hour event spanning noon would be rendered without this option.

When this config is non-zero, the headings that display the day name and number are adjusted to indicate the range of days for the column. For example, the "Wed" column for the 12th of the month will now show "Wed-Thu" for the day name and "12-13" for the day number.

dayStartTime: String | Number= 0Also a property

Either the start hour of the day, or a 24 hour HH:MM string denoting the start of the first rendered daily time block. You can also set this value to a ms timestamp representing time from midnight.

This config, along with dayEndTime determines which hours are displayed in a day column.

Note that this is only granular to the hour level. The value will be rounded down to the starting hour of the configured time.

Configuration to manage event layout class. See FluidDayLayout class docs to see all possible configurations.

Defaults to { type : 'fluid' }.

eventSpacing: Number= 1

Number of pixels to reduce the height of events by, to leave a gap between them.

fitHours: Boolean | Object= falseAlso a property

When set to true, the hours in the day will be sized so that they fit in the available height.

In the Object form, the value may contain minHeight as the minimum hour height to which the hour cells may shrink:

fitHours : {
    minHeight : 31
}

Note that if the all day events row at the top changes size, the space available for the hours will change too, and the hour cell height will change.

ParameterTypeDescription
minHeightNumber

The minimum height in pixels to which the hour cells may shrink.

By default, reconfiguring the startDate maintains the current duration of the view and moves the endDate.

But for flexibility, reconfiguring the endDate changes the duration.

Setting fixedDuration to true locks this down to changing either end just moves the view.

This flag also signals that when using multiSelect in the date picker, the selected range does not get applied to this view.

Configure this as true to hide day columns which contain no events.

Use with care. This may result in no day columns being rendered for completely empty time ranges.

The height in pixels of one hour cell in a day column.

Hour cells are bounded by lines, and there are fainter subtick lines between hour lines. These subtick change as zooming passes the hourHeightBreakpoints.

hourHeightBreakpoints: Number[]= [70,140,300,500]Also a property

An array which encapsulates a set of hourHeight breakpoints which dictate when subticks - intervening time indicators - are introduced into the DayView's time axis.

Entries are in ascending granularity order, so the values must ascend.

Subtick visibility is updated dynamically during zooming.

When an hourHeight change causes a change of sub tick granularity, a tickChange event is fired.

increment: Number= 15 minAlso a property

A millisecond value to which to snap pointer times when clicking or dragging within a day column and when calculating the hovered time for the ScheduleTooltip tooltip.

May be specified in string form eg: '15 minutes'

By default, the pointer position is rounded to the nearest increment, but this can be configured using the timeSnapType option.

By default, drag-moving an event allows the drag gesture to move the event into other day columns.

To limit drag-moving an event to only operating within the same day column, set this to false.

Note that this setting is only valid for multi-day DayView instances. For other view types, all drag gestures are inter day, so use allowDragMove for other views.

By default, drag-resizing an event (including creating a new event) allows the drag gesture to span multiple day columns to make the event an inter day event.

To limit drag-resizing an event to only operating within the same day column, set this to false.

Note that this setting is only valid for multi-day DayView instances. For other view types, all drag gestures are inter day, so use allowDragResize and allowDragCreate for other views.

maxAllDayHeight: Number | String= 50%

The maximum height the all day event row is allowed to grow within this view when it is expanded to show all its "all day" events.

This defaults to 50%, but can also be set to any CSS size value. A numeric value will be taken as pixels.

The minimum width of a day column.

If this is set, and the day columns overflow the horizontal space available, the columns will be scrollable horizontally in the normal way.

There is a horizontalScroller property which handles scrolling in this dimension.

minEventHeight: Number | String= 1emAlso a property

The minimum height to which event blocks in a day cell may shrink. If an event has very short duration, whatever the hourHeight, and regardless of timeline zooming, the event block will never drop below this height.

The minimum height in pixels to allow a zoom request to zoom out to.

A config object used to create the OverflowPopup that the allDayEvents may show when events for one day overflow the available space.

For example

    modes : {
        week : {
            overflowPopup : {
                closable   : false,
                dateFormat : 'dddd, MMM M',
                eventRenderer({ eventRecord, renderData }) {
                    if (calendarUtils.isImportantEvent(eventRecord)) {
                        // Add CSS class to important events
                        renderData.cls['b-important'] = 1;
                    }
                }
            }
        }
    }
showAllDayHeader: Boolean= true

Shows an all day header above the main schedule for All Day events. Set to false to not show all day, or multi-day events in an all day header, but to have them showing wrapping through the day cells.

By default today's date shows a current time line to indicate the current time. This line is confined to the day cell for today.

Configure this property as false to disable this.

This also may have more granular options when specified as an Object:

ParameterTypeDescription
fullWidthBoolean

When true, the line begins at the time axis edge and covers every day that this view spans.

showTimeBoolean

When true, a pill showing the highlighted current time is displayed at the appropriate position in the time axis.

onTopBoolean

Set to false, to show the current time line below events.

showTime: Boolean | Object<(startTime|endTime|duration), (Boolean|String|function())>= trueAlso a property

Configure as false to hide the start time normally shown at the top of the events.

Configuring as true (The default) means only show the start time.

Both start and end time may be selected separately:

{
    startTime : true,
    endTime   : true
}

Or start time and duration resulting in the duration being shown in the form (HH:mm) after the start time:

{
   startTime : true,
   duration  : true
}

The duration option may also be a function or the name of a function in the ownership hierarchy which is passed the event's duration in milliseconds, and must return a string to display.

By default, the most granular time tick level in the DayView's time axis is five minutes.

Set this property to true to have the hour split into six minute ticks.

Affects drag drop and moving of events with regard to the increment

If set to true, startDate will be snapped relative to event's original start. e.g. if the increment is 15 minutes, an event that starts at 10:03 and is dragged forwards would snap its start date to 10:18, 10:33 etc.

When set to false (the default), startDate will be snapped relative to the day start, eg

  • 10:03 -> 10:15, 10:20 etc.
tickRenderer: function | String

A function, or name of a function which yields a DomConfig object to use as a tick background element for the tick context passed.

tickRenderer({ startTime, tickIndex, subtickIndex, resourceRecord }) {
    // Skip subticks in the 13:00 hour
    if (!(startTime.getHours() === 13 && startTime.getMinutes())) {
        const result = {
            className : {
                'afternoon-shift' : startTime.getHours() >= 12
            },
            text : DateHelper.format(startTime, 'hh:mm a');
        };
        // And make the 13:00 cell span the whole hour
        if (startTime.getHours() === 13 && !startTime.getMinutes()) {
            result.rowspan = subTickCount;
        }
        return result;
    }
}

With some application styling:

.b-day-view-subtick {
    padding   : 0.5em;
    font-size : 0.7em;
    color     : #999;
}

.b-day-view-subtick:hover {
   background-color : rgba(0, 0, 0, 0.1);
   cursor           : pointer;
}

This is called for every visible subtick. So if the view is not tall, and only hour cells are visible, this will be called for every hour.

If half hour ticks are visible too, this will be called for every half hour, if fifteen minutes ticks are visible this will be called for every fifteen minutes etc.

By default, these ticks are sized and positioned to exactly fit the subtick cell. You may use inline style in the DomConfig return value, or a className property in the DomConfig return value to style the ticks.

Returning null will cause no tick to be rendered for that time.

The rendered element will have the class b-day-view-subtick added to it.

If the rendered element is the last subtick in an hour, the class b-last-in-hour will be added.

The rendered element's dataset will have the following properties:

  • hour - The date of the tick.
  • minute - The minute of the tick.
  • index - The index of the subtick within the hour.
ParameterTypeDescription
tickContextObject

An object containing the context for the tick being rendered.

tickContext.startTimeDate

The start time of the tick.

tickContext.endTimeDate

The end time of the tick.

tickContext.eventsEventModel[]

The events that visually intersect with the tick.

tickContext.tickIndexNumber

The zero-based overall tick index.

tickContext.subtickIndexNumber

The zero-based subtick index within the hour.

tickContext.subtickCountNumber

The total number of visible subticks in an hour.

tickContext.resourceRecordResourceModel

If this view is a resource view, the resource record.

Returns: DomConfig -

The DOM config object to use for the tick.

timeAxisTimeFormat: String | function= 'LST'

A DateHelper format string/function used to format the time displayed in the time axis at the left side of the view.

ParameterTypeDescription
dateDate

The date to format.

Returns: String -

The formatted date.

timeSnapType: round | ceil | floor | null= roundAlso a property

The type of rounding to apply when calculating a date from a pointer position in a day column.

This defaults to 'round', but may also be 'floor' or 'ceil'. A pointer position will be snapped to the appropriate increment.

Configure this as null to disable snapping so that drag and drop operations and tooltips show exact times.

visibleStartTime: String | Number | Object | null= 7

Either the start hour of the day, or a 24 hour HH:MM string denoting the initially visible start time of the day. Defaults to 7am.

Configure this as null to not have the view scroll to an initial position.

This may also be configured as an object to control how the view scrolls to the target time, with the target time specified as the time option. For example:

{
    visibleStartTime : {
        time       : '7:30',
        block      : 'closest',
        edgeOffset : 10,
        animate    : true
    }
}

The default is to scroll the time to block : 'start' with no animation.

ParameterTypeDescription
timeString | Number

The time to which to scroll the view on first render as either an hour of the day, or a 24 hour HH:MM string.

blockstart | end | center | nearest

How far to scroll the target time.

edgeOffsetNumber

edgeOffset A margin around the target to bring into view.

animateObject | Boolean | Number

Set to true to animate the scroll by 300ms, or the number of milliseconds to animate over, or an animation config object.

animate.durationNumber

The number of milliseconds to animate over.

animate.easingString

The name of an easing function.

zoomOnMouseWheel: Boolean | Number= true

You can zoom in and out on the time axis using CTRL-key + mouse wheel on mouse-based devices or pinch-zoom on touch devices. See also the hourHeightBreakpoints config option.

You cannot zoom so far out that the day height falls below the available height.

The rate at which zoom proceeeds can be changed by configuring this value as a number which will be used as a multiplier.

Note that zooming necessarily sets fitHours to false.

Configure this as false to disable this behaviour.

activationKeyCalendarMixin
allowDragCreateCalendarMixin
allowDragMoveCalendarMixin
allowDragResizeCalendarMixin
animateTimeShiftCalendarMixin
autoCreateCalendarMixin
columnWidget
dateDateRangeOwner
defaultFocusContainer
descriptionRendererCalendarMixin
dragUnitCalendarMixin
drawerPanel
endDateDateRangeOwner
eventFilterDayCellCollecter
eventHeightCalendarMixin
eventSorterCalendarMixin
extendAllDayEndDayCalendarMixin
hideNonWorkingDaysCalendarMixin
labelPositionContainer
maxDateCalendarMixin
minDateCalendarMixin
nonWorkingDaysCalendarMixin
pastEventClsCalendarMixin
rangeDateRangeOwner
renditionContainer
resourceImagePathCalendarMixin
responsiveResponsive
responsiveRootResponsive
responsiveStateResponsive
rtlRTL
selectorButtonCalendarMixin
selectorMenuItemCalendarMixin
shiftIncrementDateRangeOwner
shortDateFormatCalendarMixin
shortDateTimeFormatCalendarMixin
shortEventClsCalendarMixin
shortEventDurationCalendarMixin
showBulletCalendarMixin
showResourceAvatarsCalendarMixin
spanWidget
stackMultiDayEventsDayCellCollecter
startDateDateRangeOwner
syncCalendarDateCalendarMixin
syncViewDateCalendarMixin
timeFormatCalendarMixin
weekStartDayCalendarMixin

Accessibility

ariaLabelWidget
keyMapKeyMap

Content

bbarPanel
defaultsContainer
footerPanel
headerPanel
itemsContainer
lazyItemsContainer
namedItemsContainer
stripsPanel
tbarPanel
textContentContainer
toolsPanel

CSS

bodyClsPanel
borderContainer
clsWidget
colorWidget
htmlClsWidget
itemClsContainer
styleWidget
uiPanel

DOM

adoptWidget
appendToWidget
contentWidget
datasetWidget
htmlWidget
idWidget
tagWidget

Float & align

alignWidget
anchorWidget
centeredWidget
draggableWidget
floatingWidget
xWidget
yWidget

Layout

alignSelfWidget
dockWidget
flexWidget
heightWidget
hiddenWidget
hideWhenEmptyContainer
layoutContainer
layoutStyleContainer
marginWidget
maxHeightWidget
maxWidthWidget
minHeightWidget
minWidthWidget
textAlignWidget
weightWidget
widthWidget

misc

tabBarItemsContainer

Misc

dataFieldWidget
disabledWidget
iconPanel
localeClassLocalizable
localizableLocalizable
maskedWidget
ownerWidget
readOnlyWidget
refWidget
rippleWidget
tabWidget
titlePanel
tooltipWidget

Record

recordContainer

Scrolling

State

stateIdState

Properties

161

Common

noMatchingDates: String | DomConfig= L{noMatchingDates}Also a config

Text or HTML, or a DomConfig block to display when all dates in the range have been filtered out.

Class hierarchy

isDayView: Boolean= truereadonly
Identifies an object as an instance of DayView class, or subclass thereof.
isDayView: Boolean= truereadonlystatic
Identifies an object as an instance of DayView class, or subclass thereof.
isCalendarMixinCalendarMixin
isContainerContainer
isDateRangeOwnerDateRangeOwner
isDayCellCollecterDayCellCollecter
isDelayableDelayable
isEventsEvents
isKeyMapKeyMap
isLocalizableLocalizable
isPanelPanel
isResponsiveResponsive
isStateState
isToolableToolable
isWidgetWidget

Other

If showAllDayHeader is not set to false, then this will be an instance of CalendarRow which encapsulates the all day events at the top of this view.

By default, when mousewheel zooming out from overflowing the client height, it is not permitted to zoom further out so that the hours underflow the client height.

When zooming out, the view normally stops when the hours exactly fit the client height.

Configure this as true to allow mousewheel zooming out to cause the hours to underflow the client height.

cellMap: Mapreadonly

Yields a Map which contains the cell data for each date in the current view. This is a Map where the keys are the date strings in the format YYYY-MM-DD and the values are DayCell objects which contain the data for that cell.

Configure this property as true to show the day name and date headers in a more compact style.

When this is set, the day name and date are displayed side by side instead of on separate lines and with a smaller font size.

This applies the b-compact-header CSS class to this widget which may be styled as required.

coreHours: Object | function | StringAlso a config

An object containing two properties, start and end representing the start and end of core working hours.

This causes the non core hours to be covered by a themeable translucent grey mask in the time axis.

This may be configured to also mask the non core hours in the day part of the view by setting the overlayDay property.

{
    coreHours : {
        start      : 9,
        end        : 17,
        overlayDay : true
    }
}

If this is configured as an array of less than seven elements, it is taken to be describing multiple core hours blocks within one day, so it could be

{
    coreHours : [{
        start      : 8,
        end        : 12,
    }, {
        start      : 14,
        end        : 18
    }
}

This may also be a seven element array so as to have different core hours for each JavaScript day of the week (Meaning 0 for Sunday to 6 for Saturday). This causes only the hours in the day columns to be masked:

{
    coreHours : [{
        start : 10,
        end   : 15
    },{
        start : 9,
        end   : 17
    },{
        start : 9,
        end   : 17
    },{
        start : 9,
        end   : 17
    },{
        start : 9,
        end   : 17
    },{
        start : 9,
        end   : 17
    },{
        start : 10,
        end   : 15
    }]
}

This may also be a function to return calculated core hours for every date. This causes only the hours in the day columns to be masked:

{
    coreHours : function(date) {
        // Shorter core hours at weekends
        if (date.getDay() === 0 || date.getDay() === 6) {
            return {
                start : '10:00',
                end   : '15:00'
            };
        }
        // Pre-lunch and post-lunch working blocks in the week
        return [{
            start : '08:00',
            end   : '12:00'
        }, {
            start : '14:00',
            end   : '18:00'
        };
    }
}

This may also be a seven element array which contains separate core hours specification for each day of the week as returned from the Date class.

This may also be a function, which, when passed a Date, returns a core hours specification for that date.

In the simplest case an object containing two properties, start and end:

  • coreHours.start - The start hour or start time string HH:MM of the core working hours. Date or String value allowed.
  • coreHours.end - The end hour or start time string HH:MM of the core working hours. Date or String value allowed
  • coreHours.overlayDay - Set to true to have the greyed zone cover the day part of the view.

Only valid when this config is specified as a simple Object.

ParameterTypeDescription
dateDate

Date for hours calculation

Returns: Object[]

By default, half hour, fifteen minute tick lines are rendered in a lower contrast colour than hour lines.

Configure this as true to instead render the minor tick lines as dashed lines at the same contrast level as the hour lines.

dateFilter: function | StringAlso a config

A callback function, or the name of a function in the ownership hierarchy which an application may provide to filter out day columns for individual dates.

ParameterTypeDescription
contextDayCell

Information about the day column to be created.

Returns: Boolean -

Return false to not display a column for the passed date.

When read, this is the end time of the day, expressed in ms (6pm would be represented as 18 * 60 * 60 * 1000).

You can set this value to either an hour value (1-24), a 24 hour HH:MM string denoting the end of the last rendered daily time block or to a ms timestamp representing time from midnight.

Note that this is only granular to the hour level. The value will be rounded up to the ending hour of the specified time.

When read, this is the start time of the day, expressed in ms (7am would be represented as 7 * 60 * 60 * 1000).

You can set this value to either an hour value (0-23), a 24 hour HH:MM string denoting the start of the first rendered daily time block or to a ms timestamp representing time from midnight.

Note that this is only granular to the hour level. The value will be rounded down to the starting hour of the specified time.

fitHours: Boolean | Object= falseAlso a config

When set to true, the hours in the day will be sized so that they fit in the available height.

In the Object form, the value may contain minHeight as the minimum hour height to which the hour cells may shrink:

fitHours : {
    minHeight : 31
}

Note that if the all day events row at the top changes size, the space available for the hours will change too, and the hour cell height will change.

ParameterTypeDescription
minHeightNumber

The minimum height in pixels to which the hour cells may shrink.

By default, reconfiguring the startDate maintains the current duration of the view and moves the endDate.

But for flexibility, reconfiguring the endDate changes the duration.

Setting fixedDuration to true locks this down to changing either end just moves the view.

This flag also signals that when using multiSelect in the date picker, the selected range does not get applied to this view.

Configure this as true to hide day columns which contain no events.

Use with care. This may result in no day columns being rendered for completely empty time ranges.

A Scroller which encapsulates horizontal scrolling of the view in case a minDayWidth setting causes the days to overflow the available width.

The height in pixels of one hour cell in a day column.

Hour cells are bounded by lines, and there are fainter subtick lines between hour lines. These subtick change as zooming passes the hourHeightBreakpoints.

hourHeightBreakpoints: Number[]= [70,140,300,500]Also a config

An array which encapsulates a set of hourHeight breakpoints which dictate when subticks - intervening time indicators - are introduced into the DayView's time axis.

Entries are in ascending granularity order, so the values must ascend.

Subtick visibility is updated dynamically during zooming.

When an hourHeight change causes a change of sub tick granularity, a tickChange event is fired.

increment: Number= 15 minAlso a config

A millisecond value to which to snap pointer times when clicking or dragging within a day column and when calculating the hovered time for the ScheduleTooltip tooltip.

May be specified in string form eg: '15 minutes'

By default, the pointer position is rounded to the nearest increment, but this can be configured using the timeSnapType option.

By default, drag-moving an event allows the drag gesture to move the event into other day columns.

To limit drag-moving an event to only operating within the same day column, set this to false.

Note that this setting is only valid for multi-day DayView instances. For other view types, all drag gestures are inter day, so use allowDragMove for other views.

By default, drag-resizing an event (including creating a new event) allows the drag gesture to span multiple day columns to make the event an inter day event.

To limit drag-resizing an event to only operating within the same day column, set this to false.

Note that this setting is only valid for multi-day DayView instances. For other view types, all drag gestures are inter day, so use allowDragResize and allowDragCreate for other views.

minDayWidth: Number | StringAlso a config

The minimum width of a day column.

If this is set, and the day columns overflow the horizontal space available, the columns will be scrollable horizontally in the normal way.

There is a horizontalScroller property which handles scrolling in this dimension.

minEventHeight: Number | String= 1emAlso a config

The minimum height to which event blocks in a day cell may shrink. If an event has very short duration, whatever the hourHeight, and regardless of timeline zooming, the event block will never drop below this height.

The minimum height in pixels to allow a zoom request to zoom out to.

The OverflowPopup instance that the allDayEvents may show when events for one day overflow the available space.

Returns the resource associated with this day view when used inside a ResourceView

By default today's date shows a current time line to indicate the current time. This line is confined to the day cell for today.

Configure this property as false to disable this.

This also may have more granular options when specified as an Object:

ParameterTypeDescription
fullWidthBoolean

When true, the line begins at the time axis edge and covers every day that this view spans.

showTimeBoolean

When true, a pill showing the highlighted current time is displayed at the appropriate position in the time axis.

onTopBoolean

Set to false, to show the current time line below events.

showTime: Boolean | Object<(startTime|endTime|duration), (Boolean|String|function())>= trueAlso a config

Configure as false to hide the start time normally shown at the top of the events.

Configuring as true (The default) means only show the start time.

Both start and end time may be selected separately:

{
    startTime : true,
    endTime   : true
}

Or start time and duration resulting in the duration being shown in the form (HH:mm) after the start time:

{
   startTime : true,
   duration  : true
}

The duration option may also be a function or the name of a function in the ownership hierarchy which is passed the event's duration in milliseconds, and must return a string to display.

By default, the most granular time tick level in the DayView's time axis is five minutes.

Set this property to true to have the hour split into six minute ticks.

Affects drag drop and moving of events with regard to the increment

If set to true, startDate will be snapped relative to event's original start. e.g. if the increment is 15 minutes, an event that starts at 10:03 and is dragged forwards would snap its start date to 10:18, 10:33 etc.

When set to false (the default), startDate will be snapped relative to the day start, eg

  • 10:03 -> 10:15, 10:20 etc.
timeSnapType: round | ceil | floor | null= roundAlso a config

The type of rounding to apply when calculating a date from a pointer position in a day column.

This defaults to 'round', but may also be 'floor' or 'ceil'. A pointer position will be snapped to the appropriate increment.

Configure this as null to disable snapping so that drag and drop operations and tooltips show exact times.

$namestaticWidget
allowDragCreateCalendarMixin
allowDragMoveCalendarMixin
allowDragResizeCalendarMixin
animateTimeShiftCalendarMixin
autoCreateCalendarMixin
columnWidget
dateDateRangeOwner
dayCellClsCalendarMixin
dragUnitCalendarMixin
durationCalendarMixin
endDateDateRangeOwner
eventCountCalendarMixin
extendAllDayEndDayCalendarMixin
firstItemContainer
firstVisibleCellCalendarMixin
firstVisibleDateCalendarMixin
hasChangesContainer
hideNonWorkingDaysCalendarMixin
isValidContainer
itemsContainer
labelPositionContainer
lastItemContainer
lastVisibleCellCalendarMixin
lastVisibleDateCalendarMixin
maxDateCalendarMixin
minDateCalendarMixin
modeNameCalendarMixin
nonWorkingDaysCalendarMixin
pastEventClsCalendarMixin
rangeDateRangeOwner
renditionContainer
rtlRTL
shiftIncrementDateRangeOwner
shortDateFormatCalendarMixin
shortDateTimeFormatCalendarMixin
spanWidget
stackMultiDayEventsDayCellCollecter
startDateDateRangeOwner
stepUnitCalendarMixin
syncCalendarDateCalendarMixin
syncViewDateCalendarMixin
toolsPanel
typestaticWidget
valuesContainer
visibleCellSelectorCalendarMixin

Accessibility

keyMapKeyMap

Content

bbarPanel
tbarPanel

CSS

clsWidget

DOM

appendToWidget
contentWidget
datasetWidget
elementWidget
htmlWidget
idWidget
styleWidget

Float & align

xWidget
yWidget

Layout

alignSelfWidget
flexWidget
heightWidget
layoutContainer
layoutStyleContainer
marginWidget
maxHeightWidget
maxWidthWidget
minHeightWidget
minWidthWidget
widthWidget

Lifecycle

configBase

Misc

cellInfoWidget
disabledWidget
localeHelperLocalizable
localeManagerLocalizable
readOnlyWidget
refWidget
tabWidget
titlePanel
tooltipWidget

Record

recordContainer

State

stateState

Visibility

hiddenWidget
isVisibleWidget

Widget hierarchy

ownerWidget
parentWidget
widgetMapContainer

Functions

94

Other

Iterates the hours in the configured day, starting from the configured start hour, calling the passed callback.

ParameterTypeDescription
fnfunction | String

A function or the name of a function in the ownershop hierarchy to call.

fn.hourNumber

The hour being visited.

fn.dateDate

A Date object encapsulating the hour being visited.

fn.iNumber

Zero based loop counter.

contextDateDate

A Date object representing the day whose hours are to be visited.

Scrolls vertically to bring an event or a time into view.

ParameterTypeDescription
targetEventModel | Date | Number

The event to scroll to or a Date to read the hour value from, or an hour number.

optionsObject

How to scroll.

options.blockstart | end | center | nearest

How far to scroll the target.

options.edgeOffsetNumber

edgeOffset A margin around the target to bring into view.

options.animateObject | Boolean | Number

Set to true to animate the scroll by 300ms, or the number of milliseconds to animate over, or an animation config object.

options.animate.durationNumber

The number of milliseconds to animate over.

options.animate.easingString

The name of an easing function.

options.highlightBoolean

Set to true to highlight the target when it is in view, if the target is an EventModel.

options.focusBoolean

Set to true to focus the target when it is in view.

options.xBoolean

Pass as false to disable scrolling in the X axis.

options.yBoolean

Pass as false to disable scrolling in the Y axis.

Returns: Promise -

A promise which is resolved when the target has been scrolled into view.

Zooms the timeline by incrementing the hourHeight by the requested pixel delta.

ParameterTypeDescription
reqDeltaNumber

The number of pixels by which to increment the hourHeight

zoomCenterNumber | String

The center time to zoom in to. This may be a number of pixels down the DayView viewport, or it may be a time to use as the center in the format HH:MM:ss. If omitted, the visual central time in the viewport is used.

Note that this will usually require a layout update which happens in the next animation frame so to postprocess the new state of the view, the returned Promise must be awaited.

Zooms the timeline by setting the hourHeight to the requested pixel value.

ParameterTypeDescription
newHourHeightNumber

The new hourHeight in pixels.

zoomCenterNumber | String

The center time to zoom in to. This may be a number of pixels down the DayView viewport, or it may be a time to use as the center in the format HH:MM:ss. If omitted, the visual center of the viewport is used.

Note that this will usually require a layout update which happens in the next animation frame so to postprocess the new state of the view, the returned Promise must be awaited.

Zooms to fit all visible events within the vertical scroll viewport.

ParameterTypeDescription
optionsObject

How to scroll.

options.edgeOffsetNumber

edgeOffset A margin around the target to bring into view.

options.animateObject | Boolean | Number

Set to true to animate the scroll by 300ms, or the number of milliseconds to animate over, or an animation config object.

options.animate.durationNumber

The number of milliseconds to animate over.

options.animate.easingString

The name of an easing function.

Returns: Promise -

A promise which is resolved when the target has been scrolled into view.

addContainer
calendarHitTestCalendarMixin
composeWidget
createEventCalendarMixin
createOnFrameDelayable
disableWidget
enableWidget
focusWidget
getAtContainer
getDayElementCalendarMixin
getEventElementCalendarMixin
getEventElementsCalendarMixin
getEventRecordCalendarMixin
getResourceRecordCalendarMixin
getTimeRangesCalendarMixin
getWidgetByIdContainer
insertContainer
isTodayCalendarMixin
LstaticLocalizable
maskWidget
nextCalendarMixin
onEvents
onEventCreatedCalendarMixin
previousCalendarMixin
recomposeWidget
refreshCalendarMixin
refreshSoonCalendarMixin
relayAllEvents
removeContainer
removeAllContainer
resetValuesContainer
resolveEventRecordCalendarMixin
setValuesContainer
triggerEvents
unEvents
unmaskWidget

Configuration

applyDefaultsstaticBase

Events

Float & align

alignToWidget
setXYWidget
showByWidget
toFrontWidget

Lifecycle

createstaticWidget
destroystaticBase
initClassstaticWidget

Misc

attachTooltipstaticWidget
fromElementstaticWidget
fromSelectorstaticWidget
getByIdstaticWidget
isOfTypeNamestaticBase
mixinstaticBase
optionalLstaticLocalizable

State

Visibility

hideWidget
showWidget

Widget hierarchy

closestWidget
containsWidget
ownsWidget
queryWidget
queryAllWidget
upWidget

Events

35

Fires when this DayView changes an aspect of its layout. This happens when changing hourHeight, minDayWidth, and when the available day container height changes.

// Adding a listener using the "on" method
dayView.on('layoutUpdate', ({ source }) => {

});
ParameterTypeDescription
sourceDayView

The triggering instance.

Fires when this DayView refreshes.

// Adding a listener using the "on" method
dayView.on('refresh', ({ source }) => {

});
ParameterTypeDescription
sourceDayView

The triggering instance.

Triggered when changing the hourHeight causes an hour height breakpoint to be crossed and the displayed subTick intervals in the time axis change.

// Adding a listener using the "on" method
dayView.on('tickChange', ({ old, old.level, old.step, new, new.level, new.step }) => {

});
ParameterTypeDescription
oldObject

The old hour height tick resolution object.

old.levelNumber

The level 0 to 4 where 0 is the default with no subTick times displayed, and 4 means every 5 minute time is displayed.

old.stepString

The time duration of visible subTicks. This is a string in the format required by parseDuration

newObject

The new hour height tick resolution object.

new.levelNumber

The level 0 to 4 where 0 is the default with no subTick times displayed, and 4 means every 5 minute time is displayed.

new.stepString

The time duration of visible subTicks. This is a string in the format required by parseDuration

Fired when a time axis is clicked on. If the handler returns false the current pointer event is not processed further.

// Adding a listener using the "on" method
dayView.on('timeAxisClick', ({ domEvent, preciseTime, time }) => {

});
ParameterTypeDescription
domEventEvent

The triggering DOM event.

preciseTimeDate

The exact date and time at the clicked position

timeDate

The date and time at the clicked position snapped according to the increment and timeSnapType

beforeAutoCreateCalendarMixin
beforeChangeDateCalendarMixin
catchAllEvents
cellMapPopulatedDayCellCollecter
dayCellPopulatedDayCellCollecter
destroyEvents
eventAutoCreatedCalendarMixin
eventPropagateDayCellCollecter
expandPanel
focusInWidget
focusOutWidget
hideWidget
paintWidget
rangeChangeDateRangeOwner
readOnlyWidget
recomposeWidget
resizeWidget
shiftIncrementChangeDateRangeOwner
showWidget

Event handlers

35

Called when this DayView changes an aspect of its layout. This happens when changing hourHeight, minDayWidth, and when the available day container height changes.

new DayView({
    onLayoutUpdate({ source }) {

    }
});
ParameterTypeDescription
sourceDayView

The triggering instance.

Called when this DayView refreshes.

new DayView({
    onRefresh({ source }) {

    }
});
ParameterTypeDescription
sourceDayView

The triggering instance.

Called when changing the hourHeight causes an hour height breakpoint to be crossed and the displayed subTick intervals in the time axis change.

new DayView({
    onTickChange({ old, new }) {

    }
});
ParameterTypeDescription
oldObject

The old hour height tick resolution object.

old.levelNumber

The level 0 to 4 where 0 is the default with no subTick times displayed, and 4 means every 5 minute time is displayed.

old.stepString

The time duration of visible subTicks. This is a string in the format required by parseDuration

newObject

The new hour height tick resolution object.

new.levelNumber

The level 0 to 4 where 0 is the default with no subTick times displayed, and 4 means every 5 minute time is displayed.

new.stepString

The time duration of visible subTicks. This is a string in the format required by parseDuration

Called when a time axis is clicked on. If the handler returns false the current pointer event is not processed further.

new DayView({
    onTimeAxisClick({ domEvent, preciseTime, time }) {

    }
});
ParameterTypeDescription
domEventEvent

The triggering DOM event.

preciseTimeDate

The exact date and time at the clicked position

timeDate

The date and time at the clicked position snapped according to the increment and timeSnapType

onBeforeAutoCreateCalendarMixin
onBeforeChangeDateCalendarMixin
onCellMapPopulatedDayCellCollecter
onDayCellPopulatedDayCellCollecter
onDestroyEvents
onEventAutoCreatedCalendarMixin
onEventPropagateDayCellCollecter
onFocusInWidget
onHideWidget
onPaintWidget
onRangeChangeDateRangeOwner
onResizeWidget
onShowWidget

Typedefs

13
ActionButtonsConfig: Object<String, (String|function())>

An object which describes the properties of action buttons injected into event blocks.

ParameterTypeDescription
clsString

A class name to add to the button element. It may be of the form b-icon-xxxx which will use a font-awesome icon by that name.

tooltipString

The tooltip to show when the button is hovered.

handlerString | function

A function, or the name of a function in the ownership hierarchy to call when the button is clicked.

ParameterTypeDescription
intraDayEventsEventModel[]

The events that occur within a single day (not spanning multiple days). These are the events that have specific start and end times within the same day.

allEventsEventModel[]

A combined array containing both intraDayEvents and allDayEvents. This provides a complete list of all events for the given date.

allDayEventsEventModel[]

The events that span the entire day (all-day events). These are events that are marked as all-day events or events that span multiple days.

An object which contains properties which encapsulate hour height breakpoints which dictate when intervening time indicators are introduced into the DayView's time axis.

ParameterTypeDescription
thirtyNumber

The height at which half hour time is displayed.

fifteenNumber

The height at which all fifteen minute times are displayed.

tenNumber

The height at which all ten minute times are displayed.

fiveNumber

The height at which all five minute times are displayed.

AlignSpecWidget
ColorWidget
DayCellDayCellCollecter
EventBarDayCellCollecter
ResponsiveStateResponsive

CSS variables

82
NameDescription
--b-day-view-event-desc-line-heightLine height for the event description in the day view.
--b-day-view-event-body-paddingPadding for the event body in the day view.
--b-day-view-event-border-inline-start-widthWidth of the border at the start of the event in the day view.
--b-day-view-event-border-radiusBorder radius for events in the day view.
--b-day-view-event-name-line-heightLine height for the event name in the day view.
--b-day-view-split-widthWidth of the split line in the day view.
--b-day-view-all-day-height-transition-durationTransition duration for the height of all-day view.
--b-day-view-border-colorBorder color for the day view.
--b-day-view-hour-line-colorColor for hour lines in the day view.
--b-day-view-half-hour-line-colorColor for half-hour lines in the day view.
--b-day-view-outside-core-hours-colorColor for outside core hours in the day view.
--b-day-view-foreground-colorForeground color for the day view.
--b-day-view-inset-backgroundBackground color for insets in the day view.
--b-day-view-time-axis-colorColor for the time axis in the day view.
--b-day-view-time-axis-hour-colorColor for the hour markers on the time axis in the day view.
--b-day-view-non-working-day-backgroundBackground for non-working days in the day view.
--b-day-view-time-indicator-colorColor for the current time indicator in the day view.
--b-day-view-backgroundBackground color for the day view.
--b-day-view-today-backgroundBackground color for today in the day view.
--b-day-view-day-change-line-colorColor of the day change line when dayStartShift is used
--b-day-view-event-colorDefault color for events in the day view.
--b-day-view-event-border-inline-start-colorColor of the border at the start of the event in the day view.
--b-day-view-body-backgroundBackground color for the body of an event in the day view.
Focused
--b-day-view-focus-outline-colorColor of the focus outline for an event in the day view, when using keyboard navigation.
Hovered
--b-day-view-body-hover-mask-colorColor used to darken the body of an event on hover in the day view.
--b-day-view-resource-avatar-hover-scaleScale factor for resource avatars on hover in the day view.
--b-day-view-event-hover-body-backgroundBackground color for the body of an hovered event in the day view.
Selected
--b-day-view-body-selected-mask-colorColor used to darken the body of an event using custom coloring when selected in the day view.
--b-day-view-event-selected-colorText color for an event in the day view when selected
--b-day-view-event-selected-body-backgroundBackground color for the body of a selected event in the day view.

Inherited