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).
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.
2026-10 for a month and 2026-10-11 – 2026-10-17 for a week, the neutral form a caller can replace with its own words.
The seven dates of the week date is in.
Types
@type event() :: %{ id: String.t(), date: Date.t(), label: String.t(), kind: DevactionUI.Tone.t() }
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. Defaults to[].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.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.
@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.
2026-10 for a month and 2026-10-11 – 2026-10-17 for a week, the neutral form a caller can replace with its own words.
The seven dates of the week date is in.