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.
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:
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.
Useful configs
| Config | Description |
|---|---|
| dayStartTime | Start hour of the visible time range |
| dayEndTime | End hour of the visible time range |
| hourHeight | Pixel height of one hour cell |
| allDayEvents | Config for the all-day events row |
| eventLayout | Layout strategy for overlapping events |
| visibleStartTime | Initially visible scroll position |
See also
- Calendar — The main Calendar that hosts this view
- WeekView — Subclass of DayView that shows a full week
- CalendarRow — The all-day events row at the top of this view
- CalendarDrag — Feature for drag-creating, moving, and resizing events
Configs
Configs are options you supply in a configuration object when creating an instance of this class-
Text or HTML, or a DomConfig block to display when all dates in the range have been filtered out.
Has a corresponding runtime noMatchingDates property.
-
Number of pixels to reduce the height of events by, to leave a gap between them.
-
Configure this as
trueto hide day columns which contain no events.Use with care. This may result in no day columns being rendered for completely empty time ranges.Has a corresponding runtime hideEmptyDays 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.
Has a corresponding runtime minEventHeight property.
-
The minimum height in pixels to allow a zoom request to zoom out to.
Has a corresponding runtime minHourHeight property.
-
The event block height at which the event display rendition switches to "compact" mode with the name, then start time both on the top line with a slightly smaller font.
Has a corresponding runtime shortEventHeight property.
-
Shows an all day header above the main schedule for All Day events. Set to
falseto not show all day, or multi-day events in an all day header, but to have them showing wrapping through the day cells.
Properties
Properties are getters/setters or publicly accessible variables on this class-
Identifies an object as an instance of DayView class, or subclass thereof.
-
Text or HTML, or a DomConfig block to display when all dates in the range have been filtered out.
Has a corresponding noMatchingDates config.
-
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.Has a corresponding allDayEvents config.
-
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. -
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.
Has a corresponding dateFilter config.
-
Configure this as
trueto hide day columns which contain no events.Use with care. This may result in no day columns being rendered for completely empty time ranges.Has a corresponding hideEmptyDays config.
-
A Scroller which encapsulates horizontal scrolling of the view in case a minDayWidth setting causes the days to overflow the available width.
-
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.
Has a corresponding minEventHeight config.
-
The minimum height in pixels to allow a zoom request to zoom out to.
Has a corresponding minHourHeight config.
-
The OverflowPopup instance that the allDayEvents may show when events for one day overflow the available space.
Has a corresponding overflowPopup config.
-
Returns the resource associated with this day view when used inside a ResourceView
-
The event block height at which the event display rendition switches to "compact" mode with the name, then start time both on the top line with a slightly smaller font.
Has a corresponding shortEventHeight config.
-
Identifies an object as an instance of DayView class, or subclass thereof.