dateInput
Prompts the user for a date input. Supports single date, multiple dates, or date ranges.
Usage

const birthDate = await io.dateInput({
label: 'Date of Birth',
mode: 'single',
max: new Date().toISOString(),
})Props
| Prop | Description | Type | Required | Default |
|---|---|---|---|---|
| label | The label for the date input | string | Yes | — |
| description | The description for the date input | string | No | undefined |
| optional | Whether the date input is optional | boolean | No | false |
| min | The minimum date allowed (ISO format) | string | No | undefined |
| max | The maximum date allowed (ISO format) | string | No | undefined |
| mode | The mode of the date input | 'single' | 'multiple' | 'range' | No | 'single' |
| maxRetryAttempts | Maximum retry attempts for invalid input | number | No | 5 |
| validationSchema | Custom validation schema | z.ZodType | No | undefined |
| defaultValue | The default value for the date input | DateFieldOutput<{ mode: M }> | No | undefined |
Returns
Returns a Promise<string> for mode: 'single', Promise<string[]> for mode: 'multiple', or Promise<{ from: string; to: string }> for mode: 'range'. Return type includes | undefined if optional: true.
Examples
Date range

const vacationPeriod = await io.dateInput({
label: 'Vacation Period',
mode: 'range',
min: new Date().toISOString(),
})
// Returns: { from: string, to: string }Multiple dates

const eventDates = await io.dateInput({
label: 'Select Event Dates',
mode: 'multiple',
})
// Returns: string[] (array of ISO datetimes)