{#- chirp-ui: Date / range picker A form control: a readonly display input that opens a calendar popover for picking a single date or a date range, fully client-rendered (month nav has no server round-trip). The canonical value is an ISO `YYYY-MM-DD` string in a hidden input submitted under `name` (range adds a second hidden input under `end_name`, defaulting to `{name}_end`). Keyboard: the popover is a `role="dialog"`; the grid is a `role="grid"` of `role="gridcell"` day buttons with roving tabindex — Arrow keys move a day (Left/Right ±1, Up/Down ±7), Home/End jump to week start/end, PageUp/PageDown change month, Enter/Space pick, Escape closes and returns focus to the input. `min`/`max` (ISO) disable out-of-range days. Requires Alpine.js; v1 is Sunday-first, English labels (localization/first-day config is a follow-up). Usage: from "chirpui/date_picker.html" import date_picker {{ date_picker(name="due", label="Due date", value="2025-01-15") }} {{ date_picker(name="span", label="Date range", range=true, min="2025-01-01", max="2025-12-31") }} -#} {% def date_picker(name, label=none, value="", range=false, end_name=none, end_value="", min="", max="", placeholder="Select a date", id=none, cls="") %} {% set _pid = id or ("chirpui-date-picker-" ~ name) %} {% set _end_name = end_name or (name ~ "_end") %}