Expand description
day_pieces::datetime: core date and time pickers with native toolkit renderers and a composed DOM fallback (docs/datepicker.md; DESIGN.md §15).
let date = Signal::new(DayDate::new(2026, 7, 18).unwrap());
let time = Signal::new(DayTime::new(9, 30, 0).unwrap());
column((
date_picker(date), // Compact: field/button → platform chooser
date_picker(date).inline(), // Inline: embedded calendar / wheels
time_picker(time),
row((date_picker(date), time_picker(time))), // combined date+time = composition
))Two pieces, date_picker and time_picker, rather than one combined date-time piece: a
single combined control exists on only 3 of the 7 toolkits (NSDatePicker,
UIDatePicker.dateAndTime, QDateTimeEdit), while separate date and time controls realize
natively on all of them. Each piece maps a small style intent (Style::Compact /
Style::Inline) to the platform’s closest idiomatic control, never promising identical
chrome (Android’s Material chooser is a modal dialog, iOS’s a popover, Qt’s a calendar popup;
that difference is the platform, docs/datepicker.md has the full table).
The bound signal is two-way: a user pick sets it; the app setting it updates the native
control. Values are civil (zoneless) DayDate/DayTime; time zones are the app’s
business. The piece’s node also accepts Event::TextChanged carrying an ISO value
("2026-07-18" / "09:30") as a synthetic set, so dayscript’s existing input: step drives
any picker on any backend.
Structs§
- Date
Picker - A native date picker bound two-way to a
DayDatesignal. Build withdate_picker. - Date
Props - Full props (realize) for the date picker.
style/min/maxare set once at build; only the value patches. - DayDate
- A civil (zoneless) calendar date, proleptic Gregorian. Ordered chronologically;
DisplayandDayDate::parse_isospeak ISO-8601 (YYYY-MM-DD). - DayTime
- A civil (zoneless) wall-clock time.
DisplayandDayTime::parse_isospeak ISO-8601 (HH:MM, orHH:MM:SSwhen seconds are nonzero). - Time
Picker - A native time picker bound two-way to a
DayTimesignal. Build withtime_picker. - Time
Props - Full props (realize) for the time picker.
style/secondsare set once at build; only the value patches.
Enums§
- Date
Patch - Style
- How the picker presents (docs/datepicker.md has the per-toolkit table). Like
PickerStyle, each intent maps to the platform’s closest idiomatic control, so chrome differs per platform. - Time
Patch
Constants§
Traits§
- Date
Picker Builder - Builder methods of
DatePicker, reachable through aDecorated(docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order. - Time
Picker Builder - Builder methods of
DatePicker, reachable through aDecorated(docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.
Functions§
- date_
picker date_picker(date): a field summoning the platform’s chooser;.inline()embeds it.dateis aSignal<DayDate>or any other two-way binding (a day-modelField, mapped).- days_
in_ month - is_leap
- support
- How the pickers are realized on the compiled backend:
Native(a platform picker control) orEmulated(GTK, where GTK4/libadwaita have no stock date/time picker, so the renderer composes native primitives: GtkCalendar in a popover, linked spin buttons; also mock). - time_
picker time_picker(time): a field summoning the platform’s chooser;.inline()embeds it.