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?
string
A key to access the value. If provided, each field must have a unique key. See make for more information about accessing values.
label?
string |‌ false
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?
string
Additional information about the field, disclosed in a tooltip.
required?
boolean
Whether or not this field is required.
value?
string |‌ number
The initial value of the field. The value will be parsed by the Date constructor, and ignored if the date is invalid.
min?
string |‌ number
The earliest date that will be accepted. The value will be parsed by the Date constructor, and ignored if the date is invalid.
max?
string |‌ number
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?
string |‌ false
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?
string
Additional information about the field, disclosed in a tooltip.
value?
number |‌ null
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.