Components

Datetime-local

Usage

const date = await io.input.datetimeLocal('Meeting start time')
console.log(date) // '2024-01-14T14:22'

Parameters

labelrequired
string

The label to render above the input.

options { ... }
defaultValue
string

Default value rendered in input. Default ''.

min
string | undefined

The earliest datetime that can be selected. Default undefined.

max
string | undefined

The latest datetime that can be selected. Default undefined.

step
number

Affects step increment in seconds. Default 60.

disabled
boolean

Disables user input. Default false.

help
string

The small help text to render below the input. Default undefined.

customValidator
(input: unknown) => Promise<string | true>

An asynchronous function that takes unknown input and outputs either true or an error message string to show the user.