isoDateTimeSecond
Creates an ISO date time second validation action.
Format: yyyy-mm-ddThh:mm:ss
The regex used cannot validate the maximum number of days based on year and month. For example, "2023-06-31T00:00:00" is valid although June has only 30 days.
The regex also allows a space as a separator between the date and time parts instead of the "T" character.
const Action = v.isoDateTimeSecond<TInput, TMessage>(message);
Generics
TInputextends stringTMessageextends ErrorMessage<IsoDateTimeSecondIssue<TInput>> | undefined
Parameters
messageTMessage
Explanation
With isoDateTimeSecond you can validate the formatting of a string. If the input is not an ISO date time with seconds, you can use message to customize the error message.
Returns
ActionIsoDateTimeSecondAction<TInput, TMessage>
Examples
The following examples show how isoDateTimeSecond can be used.
ISO date time second schema
Schema to validate an ISO date time with seconds.
const IsoDateTimeSecondSchema = v.pipe(
v.string(),
v.isoDateTimeSecond('The date is badly formatted.')
);
Related
The following APIs can be combined with isoDateTimeSecond.
Schemas
Methods
Utils
© Fabian Hiller
Licensed under the MIT License.
https://valibot.dev/api/isoDateTimeSecond/