A month or a week of days with their events, as an agenda of deliveries: each event is a coloured chip by kind
(risk, warning, ok, info, neutral). It is a grid (role="grid", rows, column headers, cells) with one cell in
the tab order and the arrows, Home, End and Page keys moving between days (DevactionUI.Calendar hook);
pressing a day, or Enter on it, sends select_event with phx-value-date, and the previous and next buttons
send prev_event and next_event.
The server owns the dates: month_weeks/3 and week_days/2 give the days to draw, so the grid is the same
in the browser and in a test. The names of the months and of the days come from the caller (the library
holds no language): title is written by the caller, and cell_label (a function of the day and its events)
names each cell for screen readers.
The week view is the seven days of the week as cells with all their events as chips, or, when hours is
given (a range such as 8..17, the last hour included), a grid of hours: a time column, a column per day
(weekend={false} drops Saturday and Sunday, and the caller then gives five weekdays) and each event with a
starts_at (and an ends_at, a Time) drawn at its time with its length, the ones that overlap side by
side (DevactionUI.Calendar.Layout). An event without a starts_at is an all-day one and sits in a strip
above the hours; detail is a second line under the label. Days outside the shown month are drawn dimmed
and without events.
Event kinds are the tones of DevactionUI.Tone or the four categories :chart_1 to :chart_4, drawn in the
--chart-* colours; the legend slot names the kinds in use under the grid.
Summary
Functions
The weeks of a month, each a list of seven dates, from the week that holds the 1st to the one that holds the last day.
The first day of the month before and after the month of date.
10/2026 for a month and 11/10 – 17/10/2026 for a week, the neutral form a caller replaces with its own words.
The seven dates of the week date is in.
Types
Functions
Attributes
id(:string) (required)label(:string) (required) - the name of the grid, e.g.Deliveries in October 2026.title(:string) (required) - the month or the week, as written for the person.date(:any) (required) - a date of the month (or of the week) shown.view(:atom) - Defaults to:month. Must be one of:month, or:week.week_start(:atom) - Defaults to:sunday. Must be one of:sunday, or:monday.today(:any) (required) - aDate: today in the workspace's time zone.selected(:any) - Defaults tonil.events(:list) -%{id, date, label, kind}each, andstarts_at,ends_atanddetailfor the hours grid. Defaults to[].hours(:any) - a range of hours such as8..17: the week view becomes a grid of hours. Defaults tonil.weekend(:boolean) - false drops Saturday and Sunday from the grid of hours. Defaults totrue.hour_label(:any) - a function of an hour (0 to 23) returning the text of the time column;HH:00when nil. Defaults tonil.weekdays(:list) (required) - seven short names, in the order of the week start.more_label(:string) (required) -+%{count} more, with the count placed by the caller.cell_label(:any) - a function of the day and its events returning the name of the cell for screen readers;dd/mm/yyyy: labelswhen nil. Defaults tonil.prev_label(:string) (required)next_label(:string) (required)select_event(:string) (required)prev_event(:string) (required)next_event(:string) (required)class(:any) - Defaults tonil.target(:any) - aphx-target(a@myself) when used inside a LiveComponent. Defaults tonil.- Global attributes are accepted.
Slots
prev_iconnext_iconactions- controls beside the arrows, such as a month and week switch.legend- one entry per kind in use, drawn under the grid with its colour. Accepts attributes:kind(:atom) (required)
@spec month_weeks(pos_integer(), 1..12, :sunday | :monday) :: [[Date.t()]]
The weeks of a month, each a list of seven dates, from the week that holds the 1st to the one that holds the last day.
The first day of the month before and after the month of date.
10/2026 for a month and 11/10 – 17/10/2026 for a week, the neutral form a caller replaces with its own words.
The seven dates of the week date is in.