A month calendar that picks one day or a range, and the small chip that says how near a deadline is.
date_picker/1 is drawn by a hook, so the months turn without the server. The server gives it only what it
alone knows: the day that is today in the workspace's time zone (today), the shortcuts (Today,
Friday, +7 days, End of the milestone, each with its ISO date) and the texts. Month and weekday names
come from the browser's Intl in the locale given. The choice goes into hidden inputs (name for one
day, name_from and name_to for a range), as ISO dates, and the hook fires input so phx-change hears it.
Keys: ← → move a day, ↑ ↓ a week, PageUp and PageDown a month, Home and End the week, Enter or Space
picks. Days before min are dimmed and cannot be picked.
due_chip/1 compares a date with today and draws it late (red), due today (amber) or later (neutral).
Summary
Functions
Attributes
id(:string) (required)name(:string) (required)mode(:atom) - Defaults to:single. Must be one of:single, or:range.value(:any) - an ISO date, or{from, to}for a range, or nil. Defaults tonil.today(:string) (required) - today's ISO date in the workspace's time zone.min(:string) - the first ISO date that can be picked. Defaults tonil.locale(:string) - Defaults to"en".week_start(:integer) - 0 for Sunday, 1 for Monday. Defaults to0.previous_label(:string) (required)next_label(:string) (required)class(:any) - Defaults tonil.- Global attributes are accepted.
Slots
shortcut- Accepts attributes:date(:string) (required) - an ISO date.
Attributes
:late, :today or :later.