Skip to main content

docked_date_picker

Function docked_date_picker 

Source
pub fn docked_date_picker() -> DockedDatePickerBuilder
Expand description

§docked_date_picker

Select a date with separate month and year menus beside a date-entry field.

§Usage

Show an anchored calendar for dates in the near or distant past or future.

§Parameters

  • modifier — placement and optional constraints on the 360dp calendar.
  • state — selection, displayed month and selectable-date restrictions.
  • view — optional shared calendar/month/year view state; when omitted, the calendar manages its own view.
  • first_day_of_week — first weekday in the calendar, Monday by default.
  • today — date outlined as today; defaults to the system date.
  • show_actions — show Cancel and OK, enabled by default.
  • on_date_change — called after an allowed date is selected.
  • on_cancel, on_confirm — dismissal and confirmation actions; the owner controls the popup and any rollback of an unconfirmed selection.

§Examples

use tessera_components::date_picker::{CalendarDate, DatePickerState};
let mut state = DatePickerState::default();
let selected = CalendarDate::new(2025, 8, 17).unwrap();
assert!(state.set_selected_date(selected));
assert_eq!(state.selected_date(), Some(selected));