TimeSchemaclass

new TimeSchema({ one = "time", title = "Time", input = "time", ...options }: DateSchemaOptions)
ParamType
optionsDateSchemaOptions
Options for DateSchema. required
    .valuePossibleDate
Default date used when the input is undefined. readonly
    .minNullish<PossibleDate>
Earliest allowed date (null for no bound). readonly
    .maxNullish<PossibleDate>
Latest allowed date (null for no bound). readonly
    .inputDateInputType
HTML <input /> type="" hint for downstream UIs. Defaults to "date" readonly
    .stepnumber
Rounding step (in milliseconds, because that's the base unit for time).
- E.g. 1000 * 60 will round to the nearest minute.
- Note: HTML <input> step attributes are in seconds, so you may need to convert units. readonly
Return
TimeSchema
Schema that defines a valid abstract time in 24h hh:mm:ss.fff format, e.g. 23:59 or 24:00.

Schema that defines a valid abstract time in 24h hh:mm:ss.fff format, e.g. 23:59 or 24:00.

Examples

const schema = new TimeSchema({});
 schema.validate("23:59"); // "23:59:00.000"