0.7.4 gives the Ambient pack weather. A page names one feed URL on its own site, and the pack sets data-weather from it, uses its sunrise and sunset for dawn and dusk, and never shows a stale observation. Helpers for producing the feed from Open-Meteo are included. Ambient p…
Hour-grid schedule for a single day using calendar-event and hour-view elements with two-layer rendering for multi-hour spanning.
Overview
The <day-view> component renders a day schedule as an hour grid. Authors write semantic markup using <ol>, <time>, <hour-view>, and <calendar-event>. The component enhances this with a two-layer rendering system: CSS Grid for the hour layout, and JS absolute positioning for events that span multiple hours.
Markup Pattern
Each hour is an <li> containing a <time> label and an <hour-view> container. Events go inside <hour-view> as <calendar-event> elements.
The date this view represents. Names the hour list for assistive tech (“Friday, April 10, 2026”) and is passed as detail.date in day-view:event-click.
data-start-hour
number | "auto"
7
First hour of the grid the component generates when you place <calendar-event> children directly inside (no <ol>), or "auto" for a sparse range around the events. A numeric range grows to fit events outside it. Ignored when you author the <ol>.
data-end-hour
number
19
Last hour of the generated grid. Ignored when data-start-hour="auto" or the <ol> is authored.
data-compact
boolean
—
Compact presentation for embedding in dialogs or overlays.
data-label-continues
string
"continues after the visible hours"
Appended to the accessible name of a spanning event clipped at the last visible hour. Localisation hook.
Generated Grid
Place <calendar-event> children directly inside <day-view> (no <ol>) and the component builds the hour grid from each event’s <time datetime>. Untimed events go to an all-day strip.
data-start-hour="auto": sparse range, first event hour − 1 to last event hour + 1.
Numeric data-start-hour / data-end-hour (default 7–19): a fixed range that grows to fit any event outside it, so no event is dropped.
datetime may be HH:MM or a full ISO datetime (2026-04-10T09:30:00Z). The wall-clock time is used as written; offsets are not converted to local time.
Anything else (including zero) falls back to one hour. <week-view> reads durations the same way.
Leave the subsequent hour's <hour-view> empty — the spanning event overlays it visually. Spans are re-measured whenever the view resizes; call refresh() after changing data-duration yourself.
Overlapping and Clipped Spans
Spanning events whose times overlap are laid out side by side, each taking an equal share of the event column. A span that runs past the last visible hour (or past midnight) is clipped at the bottom of the grid, gets data-continues and a dashed end edge, and its accessible name gains “continues after the visible hours” (see data-label-continues).
When two events occupy the same time slot, add data-overlap to the <hour-view> to display them side by side.
Two events at 2 PM
12345678910
<hour-viewdata-overlap><calendar-eventdata-category="focus"><timedatetime="14:00">2:00</time> Code review</calendar-event><calendar-eventdata-category="meeting"><timedatetime="14:00">2:00</time> 1:1 with Sarah</calendar-event></hour-view>
All-Day Events
Place all-day events in a <ul class="all-day-events"> above the hour list. In a generated grid, events without a <time datetime> are moved there for you.
All-day event
1234567891011
<day-view><ulclass="all-day-events"><li><calendar-eventdata-category="personal"><icon-wcname="globe"size="sm"></icon-wc> Earth Day (all day)</calendar-event></li></ul><ol>...</ol></day-view>
Events
Event
Detail
Description
day-view:event-click
{ date, time, text, element, category, duration }
Fired when a <calendar-event> is clicked, or activated with Enter / Space while focused.
day-view:events-changed
{ events, source: 'property' }
Fired after assigning the events property rebuilds the view.
JavaScript API
Member
Description
events (get)
The current <calendar-event> children as data: { time, text, category?, duration?, href? }[].
events (set)
Replace every event and rebuild the view. Sets data-start-hour="auto". time is HH:MM or a full ISO datetime; omit it for an all-day event. Emits day-view:events-changed.
Multi-hour spanning events (measured against grid rows)
Hour dividers use box-shadow instead of border to avoid gaps in the spanning calculations.
Progressive Enhancement
Layer
What renders
HTML only
Ordered list of hours with events — readable, semantic
+ CSS
Category colours and event blocks; the hours stay a numbered list
+ JS
Hour-grid layout and half-hour positioning (applied once upgraded, via data-upgraded), generated grids, multi-hour spanning, click events, keyboard navigation
Keyboard
Key
Action
Arrow Down
Move focus to next event
Arrow Up
Move focus to previous event
Home / End
Move focus to the first / last event
Enter / Space
Fire day-view:event-click for the focused event
Events are one roving tab stop: Tab enters the schedule on the last-focused event (the first one initially). Each event gets role="button", so it is announced as something that can be activated, and an accessible name from its time and title (author-supplied role / aria-label are kept). An event that contains its own links or controls gets role="group" instead, because a button cannot contain other controls. Links and buttons inside an event keep their own behaviour; Enter on them does not fire day-view:event-click.