About Docs GitHub Sign in

Date field

Either a date or a date and time field, similar to the date and datetime inputs.

Options

Option Type Description
format string The date (or datetime) format (e.g. dd/MM/yyyy). This should be a valid date-fns format string. Default to yyyy-MM-dd, or yyyy-MM-dd'T'HH:mm if time is true (see below).
time string If true, the field will allow the user to pick a date and a time using a <datetime> field. Default is false.
min string The earliest date to accept. If undefined, there is no min date. This must be formatted as a standard min value for a date input (i.e. yyyy-mm-dd) or min value for a datetime input (i.e. YYYY-MM-DDThh:mm).
min string The latest date to accept. If undefined, there is no max date. This must be formatted as a standard max value for a date input (i.e. yyyy-mm-dd) or max value for a datetime input (i.e. YYYY-MM-DDThh:mm).
step string Defines the granularity of values: number of days, or number of seconds if time is set to true. Behavior is the same as step for date and datetime inputs.

Examples

A simple example for a date that must be be December 24, 2023 or after:

- name: created
  label: Creation date
  type: date
  options:
    format: dd-MM-yyyy
    min: 2023-12-24 # Must be on or after December 24, 2023. Notice it uses the format defined above.

Another example with time:

- name: start_time
  label: Starts at 
  options:
    time: true
    format: dd-MM-yyyy HH:mm

On this page