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…
7-day time grid composing day-view-style columns in a semantic table with auto mode, spanning events, and keyboard navigation.
Overview
The <week-view> component renders a weekly schedule as a semantic <table> styled with CSS Grid and subgrid. Each column represents a day; each row an hour. Events are <calendar-event> elements placed in the correct cell, with support for multi-hour spanning and double-booking.
Auto Mode
Place <calendar-event> children with data-date attributes directly inside <week-view>. The component scans event dates and times, computes the hour range, and builds the table automatically.
Each <calendar-event> must have data-date="YYYY-MM-DD" to assign it to a day column, and a <time datetime> for the hour slot. The datetime may be HH:MM or a full ISO datetime; the wall-clock time is used as written (offsets are not converted). Events without a date in range or without a time are not placed: once the component upgrades they are hidden (they stay in the events getter, so a set→get round-trips).
Without data-start-date the view shows the current week, starting on the first day of the week for the closest [lang] (Sunday for en-US, Monday for de or en-GB; read from Intl.Locale week info). An empty <week-view> still renders the grid. Today’s day header carries aria-current="date" and is highlighted.
Durations are parsed exactly as in <day-view>: 2h, 1.5h, 45m, 90m, 1h30m, bare minutes (60) and ISO-8601 (PT1H30M); anything else falls back to one hour. Overlapping spans in the same day column are laid out side by side. A span running past the last visible hour is clipped, marked data-continues (dashed end edge) and its accessible name says it continues. Spans re-measure when the view resizes; call refresh() after changing data-duration yourself.
Table Structure
The generated table uses semantic elements for accessibility: <th scope="col"> for day headers and <th scope="row"> for hour labels. CSS Grid with subgrid provides the visual layout.
Element
Purpose
<table>
Grid container for the hours × days layout
<thead> <th>
Day column headers with <time> elements. The visible text is short (“Mon 6”, with the month added when the range crosses one); the header’s accessible text is the full date. Today’s has aria-current="date".
<tbody> <th>
Hour row headers with <time datetime="HH:00">
<td>
Day/hour cell containing <hour-view> + events
Events
Event
Detail
Description
week-view:event-click
{ date, time, text, element, category, duration }
Fired when a <calendar-event> is clicked, or activated with Enter / Space while focused.
week-view:events-changed
{ events, source: 'property' }
Fired after assigning the events property rebuilds the table.
JavaScript API
Member
Description
events (get)
The current events as data: { date, time, text, category?, duration? }[].
events (set)
Replace every event and rebuild the table. time is HH:MM or a full ISO datetime, whose date is used when date is omitted. Emits week-view:events-changed.
refresh()
Re-measure and re-position spanning events now.
Keyboard
Key
Action
Arrow Down
Next event of the same day, in time order (including events that share an hour cell)
Arrow Up
Previous event of the same day, in time order
Arrow Right
The event closest in time on the next day that has any events (the previous day in right-to-left layouts)
Arrow Left
The event closest in time on the previous day that has any events (the next day in right-to-left layouts)
Home / End
First / last event of the view, by date and then time
Enter / Space
Fire week-view:event-click for the focused event
Every placed event can be reached with the arrow keys. Events are one roving tab stop, starting on the first event by date and time. Each gets role="button" (role="group" when it holds links or controls of its own) and an accessible name from its time and title (author-supplied role / aria-label are kept).
Accessibility
The grid is a real <table>: day headers are <th scope="col"> named with the full date, hour labels are <th scope="row">, and the corner header has visually hidden text (data-label-time).
Grid lines are logical borders, so they mirror in right-to-left layouts and stay visible in forced-colors (Windows High Contrast) mode.
Today is conveyed by aria-current="date" as well as colour and a thicker rule.
Progressive Enhancement
Layer
What renders
HTML only
Calendar events render as a flat list (readable without JS)
+ CSS
Category colours and event blocks; an authored table stays a plain bordered table
+ JS
Auto table generation, the grid/subgrid layout (applied once upgraded), spanning events, click handling, keyboard nav