pub struct RangeSelection { /* private fields */ }Expand description
Can select a date range.
-
Movement with the arrow-keys and PageUp/PageDown.
-
Ctrl+Home moves to today.
-
Ctrl+A selects the current month.
-
Shift+Arrow extends the selection.
-
Shift+PageUp/PageDown extends the selection by a whole month.
-
Alt+Shift+Up/Down extends the selection by a whole week.
Implementations§
Source§impl RangeSelection
impl RangeSelection
Sourcepub fn select_month(&mut self, date: NaiveDate, extend: bool) -> bool
pub fn select_month(&mut self, date: NaiveDate, extend: bool) -> bool
Select the week of the given date.
If extend is used, this will extend the selection to include the new week. If the current selection doesn’t cover full weeks it will be buffed up to do so afterwards.
Sourcepub fn select_week(&mut self, date: NaiveDate, extend: bool) -> bool
pub fn select_week(&mut self, date: NaiveDate, extend: bool) -> bool
Select the week of the given date.
If extend is used, this will extend the selection to include the new week. If the current selection doesn’t cover full weeks it will be buffed up to do so afterwards.
Sourcepub fn select_day(&mut self, date: NaiveDate, extend: bool) -> bool
pub fn select_day(&mut self, date: NaiveDate, extend: bool) -> bool
Select a date.
Sourcepub fn select(&mut self, selection: (NaiveDate, NaiveDate)) -> bool
pub fn select(&mut self, selection: (NaiveDate, NaiveDate)) -> bool
Select range as (anchor, lead) pair.
Sourcepub fn selected_range(&self) -> Option<RangeInclusive<NaiveDate>>
pub fn selected_range(&self) -> Option<RangeInclusive<NaiveDate>>
Selection as date-range.
Trait Implementations§
Source§impl CalendarSelection for RangeSelection
impl CalendarSelection for RangeSelection
Source§impl Clone for RangeSelection
impl Clone for RangeSelection
Source§fn clone(&self) -> RangeSelection
fn clone(&self) -> RangeSelection
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RangeSelection
impl Debug for RangeSelection
Source§impl Default for RangeSelection
impl Default for RangeSelection
Source§fn default() -> RangeSelection
fn default() -> RangeSelection
Auto Trait Implementations§
impl Freeze for RangeSelection
impl RefUnwindSafe for RangeSelection
impl Send for RangeSelection
impl Sync for RangeSelection
impl Unpin for RangeSelection
impl UnwindSafe for RangeSelection
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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