isoTime
Creates an ISO time validation action.
Format: hh:mm
const Action = v.isoTime<TInput, TMessage>(message);
Generics
TInputextends stringTMessageextends ErrorMessage<IsoTimeIssue<TInput>> | undefined
Parameters
messageTMessage
Explanation
With isoTime you can validate the formatting of a string. If the input is not an ISO time, you can use message to customize the error message.
Returns
ActionIsoTimeAction<TInput, TMessage>
Examples
The following examples show how isoTime can be used.
ISO time schema
Schema to validate an ISO time.
const IsoTimeSchema = v.pipe(
v.string(),
v.isoTime('The time is badly formatted.')
);
Related
The following APIs can be combined with isoTime.
Schemas
Methods
Utils
© Fabian Hiller
Licensed under the MIT License.
https://valibot.dev/api/isoTime/