pub struct DatePicker { /* private fields */ }Expand description
A date field with a calendar: month and year views, keyboard navigation,
minimum and maximum dates. The value is an ISO date (2026-09-18); it is
shown in the visitor’s locale.
let html = render_static(DatePicker![label = "Birthday", name = "birthday", max = "2026-12-31"]);
assert!(html.contains(r#"type="date""#) && html.contains(r#"data-nr-ui="datepicker""#));Implementations§
Source§impl DatePicker
impl DatePicker
pub fn new() -> Self
pub fn placeholder(self, v: impl Into<String>) -> Self
Sourcepub fn description(self, v: impl MaybeText) -> Self
pub fn description(self, v: impl MaybeText) -> Self
Help text under the field.
Sourcepub fn error_message(self, v: impl MaybeText) -> Self
pub fn error_message(self, v: impl MaybeText) -> Self
Error text under the field; also marks it invalid.
error_message = form.error("email") shows server validation errors.
Sourcepub fn name(self, v: impl Into<String>) -> Self
pub fn name(self, v: impl Into<String>) -> Self
Form field name. Server-action validation errors for this name appear under the field automatically.
pub fn required(self, v: bool) -> Self
pub fn disabled(self, v: bool) -> Self
pub fn readonly(self, v: bool) -> Self
pub fn size(self, v: Size) -> Self
pub fn variant(self, v: FieldVariant) -> Self
pub fn radius(self, v: Radius) -> Self
pub fn label_placement(self, v: LabelPlacement) -> Self
Sourcepub fn start_content(self, v: impl View) -> Self
pub fn start_content(self, v: impl View) -> Self
Content at the start of the box, typically an icon.
Sourcepub fn end_content(self, v: impl View) -> Self
pub fn end_content(self, v: impl View) -> Self
Content at the end of the box.
Sourcepub fn full_width(self, v: bool) -> Self
pub fn full_width(self, v: bool) -> Self
Take the full width of the container (the default).
Sourcepub fn label_class(self, v: impl Into<String>) -> Self
pub fn label_class(self, v: impl Into<String>) -> Self
Extra classes for the label.
Sourcepub fn wrapper_class(self, v: impl Into<String>) -> Self
pub fn wrapper_class(self, v: impl Into<String>) -> Self
Extra classes for the box around the control.
Sourcepub fn input_class(self, v: impl Into<String>) -> Self
pub fn input_class(self, v: impl Into<String>) -> Self
Extra classes for the control itself.
pub fn description_class(self, v: impl Into<String>) -> Self
pub fn error_class(self, v: impl Into<String>) -> Self
Sourcepub fn class(self, v: impl Into<String>) -> Self
pub fn class(self, v: impl Into<String>) -> Self
Extra classes for the outer element. They win over the defaults.
Sourcepub fn with(self, part: impl Part) -> Self
pub fn with(self, part: impl Part) -> Self
Add an attribute to the date input; class(..) goes to the outer element.
Sourcepub fn first_day_of_week(self, v: u8) -> Self
pub fn first_day_of_week(self, v: u8) -> Self
First day of the week: 0 = Sunday (default), 1 = Monday, …