pub struct DateFilter<M> { /* private fields */ }Expand description
Date filter matching a date or time field by calendar day, or by a range of days; see
FilterDate for the types.
A value names one day, f.<name>=2024-01-15, a timestamp’s in the request’s
time_zone; on a range filter the parts
f.<name>.from and f.<name>.to name the first and the last day of a range, either one
alone leaving it open. A value naming an exact time, such as a jiff::Timestamp’s
2024-01-15T09:30:00Z, or its 2024-01-15T09:30 read in the request’s time zone, matches that
time, or bounds the range at it.
DateFilter::new(lens!(Post.created_at)).range();Implementations§
Source§impl<M> DateFilter<M>
impl<M> DateFilter<M>
Sourcepub fn new<T>(lens: impl Into<Path<M, T>>) -> DateFilter<M>where
T: FilterDate,
pub fn new<T>(lens: impl Into<Path<M, T>>) -> DateFilter<M>where
T: FilterDate,
Filter the field lens binds to one calendar day, or a range of days.
Sourcepub fn label(self, label: impl Into<Text>) -> DateFilter<M>
pub fn label(self, label: impl Into<Text>) -> DateFilter<M>
The label the control renders, over the field’s.
Sourcepub fn range(self) -> DateFilter<M>
pub fn range(self) -> DateFilter<M>
Choose a range of days: the control is two inputs, submitting the from and to parts.
Trait Implementations§
Source§impl<M> Clone for DateFilter<M>
impl<M> Clone for DateFilter<M>
Source§fn clone(&self) -> DateFilter<M>
fn clone(&self) -> DateFilter<M>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<M> Debug for DateFilter<M>
impl<M> Debug for DateFilter<M>
Source§impl<M> Filter<M> for DateFilter<M>
impl<M> Filter<M> for DateFilter<M>
Source§fn to_expr(&self, cx: &Cx, value: &FilterValue) -> Option<Expr<bool>>
fn to_expr(&self, cx: &Cx, value: &FilterValue) -> Option<Expr<bool>>
One day for a single value, or the range its from and to parts bound; None for both,
another part, a value beside the parts, a range ending before it starts, or a part where
range is off, whose one input does not render it.
Source§fn control<'a>(&self, cx: &'a Cx, input: FilterInput) -> Pin<Box<dyn View + 'a>>
fn control<'a>(&self, cx: &'a Cx, input: FilterInput) -> Pin<Box<dyn View + 'a>>
The bound inputs: a date input for a day, a text input for a bound a date input cannot hold.
Source§fn is_noop_value(&self, _value: &FilterValue) -> bool
fn is_noop_value(&self, _value: &FilterValue) -> bool
value selects no predicate without being invalid.Source§fn load_control<'s, 'a>(
&'s self,
cx: &'a Cx,
input: FilterInput,
) -> Pin<Box<dyn Future<Output = Pin<Box<dyn View + 'a>>> + Send + 's>>where
'a: 's,
fn load_control<'s, 'a>(
&'s self,
cx: &'a Cx,
input: FilterInput,
) -> Pin<Box<dyn Future<Output = Pin<Box<dyn View + 'a>>> + Send + 's>>where
'a: 's,
control.