pub struct DateRangeState {
pub view_year: i32,
pub view_month: u32,
pub view_day: u32,
pub start: Option<Date>,
pub end: Option<Date>,
pub hovered: Option<Date>,
pub user_navigated: bool,
}Expand description
State entity for DateRangePicker.
Fields§
§view_year: i32Year of the month currently shown.
view_month: u32Month (1-12) currently shown.
view_day: u32Anchor day for the week and day views; the month view ignores it.
start: Option<Date>Start of the selected range, if any.
end: Option<Date>End of the selected range, if any.
hovered: Option<Date>Live cell under the cursor — drives the hover preview range.
Set once the user pages or picks, after which selectionAlignment
stops re-deriving the visible range.
Implementations§
Source§impl DateRangeState
impl DateRangeState
Sourcepub fn new(_cx: &mut App) -> Self
pub fn new(_cx: &mut App) -> Self
Creates a state showing the current month with no range selected.
Sourcepub fn with_range(cx: &mut App, start: Option<Date>, end: Option<Date>) -> Self
pub fn with_range(cx: &mut App, start: Option<Date>, end: Option<Date>) -> Self
defaultValue — a state seeded with an initial range.
Sourcepub fn set_anchor(&mut self, date: Date)
pub fn set_anchor(&mut self, date: Date)
Moves the visible range, recording that the user drove it.
Sourcepub fn preview_end(&self) -> Option<Date>
pub fn preview_end(&self) -> Option<Date>
The range’s moving edge while the user hovers before picking the end.
Auto Trait Implementations§
impl Freeze for DateRangeState
impl RefUnwindSafe for DateRangeState
impl Send for DateRangeState
impl Sync for DateRangeState
impl Unpin for DateRangeState
impl UnsafeUnpin for DateRangeState
impl UnwindSafe for DateRangeState
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more