Date
The date field can be used to input a date. Advanced keyboard controls allow for pasting full dates, quick cycling through days, months and years, and navigating between date parts. A button allows for quick selection of the current date.
Example
{
type: "date",
label: "Date",
value: "2024-07-04",
}Options
Input
Use these options when using the field with take.
key? | A key to access the value. If provided, each field must have a unique key. See make for more information about accessing values. |
label? | A label describing the purpose of the field. Setting the label to false removes the element, which can be useful when nested as the only child within a group. |
detail? | Additional information about the field, disclosed in a tooltip. |
required? | Whether or not this field is required. |
value? | The initial value of the field. The value will be parsed by the Date constructor, and ignored if the date is invalid. |
min? | The earliest date that will be accepted. The value will be parsed by the Date constructor, and ignored if the date is invalid. |
max? | The latest date that will be accepted. The value will be parsed by the Date constructor, and ignored if the date is invalid. |
Output
Use these options when using the field with make.
label? | A label describing the purpose of the field. Setting the label to false removes the element, which can be useful when nested as the only child within a group. |
detail? | Additional information about the field, disclosed in a tooltip. |
value? | The output value of the field. |
Data
If the input is a valid date, the field will return a string in the format "YYYY-MM-DD" between min and max, or null if one hasn’t been set yet.