pub struct DatePicker { /* private fields */ }Expand description
A month calendar grid: header with prev/next month nav, weekday labels,
a 7-column day grid. Controlled — the app owns viewed_month/selected.
Implementations§
Source§impl DatePicker
impl DatePicker
pub fn new(viewed_month: SimpleDate) -> Self
pub fn selected(self, d: SimpleDate) -> Self
pub fn today(self, d: SimpleDate) -> Self
pub fn min_date(self, d: SimpleDate) -> Self
pub fn max_date(self, d: SimpleDate) -> Self
pub fn accent(self, c: Color) -> Self
Sourcepub fn mode(self, m: SelectionMode) -> Self
pub fn mode(self, m: SelectionMode) -> Self
Selection mode — Single (default) or Range.
Sourcepub fn range(self, start: SimpleDate, end: Option<SimpleDate>) -> Self
pub fn range(self, start: SimpleDate, end: Option<SimpleDate>) -> Self
The current (start, end) selection for Range mode.
Sourcepub fn range_color(self, c: Color) -> Self
pub fn range_color(self, c: Color) -> Self
The in-between band fill color (default: a faint accent).
Sourcepub fn axis(self, a: PageAxis) -> Self
pub fn axis(self, a: PageAxis) -> Self
Direction month transitions slide — Horizontal (default) or Vertical.
Sourcepub fn on_select(
self,
f: impl Fn(SimpleDate, Option<SimpleDate>) + Send + Sync + 'static,
) -> Self
pub fn on_select( self, f: impl Fn(SimpleDate, Option<SimpleDate>) + Send + Sync + 'static, ) -> Self
The one selection callback, fired right after a day is chosen. It
receives (start, end):
Singlemode →(date, None).Rangemode →(start, None)when the start is picked, then(start, Some(end))once the range completes (drag reports the live(start, Some(end))as you sweep).
Sourcepub fn on_month_change(
self,
f: impl Fn(SimpleDate) + Send + Sync + 'static,
) -> Self
pub fn on_month_change( self, f: impl Fn(SimpleDate) + Send + Sync + 'static, ) -> Self
Called with the new viewed month when the prev/next nav is pressed.
Trait Implementations§
Source§impl Widget for DatePicker
impl Widget for DatePicker
Source§fn layout(&self, ctx: &LayoutCtx<'_>) -> Size
fn layout(&self, ctx: &LayoutCtx<'_>) -> Size
Measure under
ctx.constraints and return a size within them. Read moreSource§fn children(&self) -> Children<'_>
fn children(&self) -> Children<'_>
Declare this widget’s children. Drives every default below.
Source§fn flex_factor(&self) -> f32
fn flex_factor(&self) -> f32
Flex weight inside Row/Column. Wrappers are transparent by default.
Auto Trait Implementations§
impl !RefUnwindSafe for DatePicker
impl !UnwindSafe for DatePicker
impl Freeze for DatePicker
impl Send for DatePicker
impl Sync for DatePicker
impl Unpin for DatePicker
impl UnsafeUnpin for DatePicker
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<W> FocusApi for W
impl<W> FocusApi for W
Source§fn focus_node(self, node: FocusNode) -> WithFocus<Self>
fn focus_node(self, node: FocusNode) -> WithFocus<Self>
Attach a focus node. This enables focus-ring rendering and explicit
neighbor wiring.