Time
Format 24-hour time with optional seconds
Time
The time formatter masks a 24-hour time string into HH:mm or HH:mm:ss.
Options
| Option | Type | Default | Description |
|---|---|---|---|
seconds | boolean | false | Include the seconds part (HH:mm:ss). |
Usage
validationSchema: {
start: { format: { type: "time" } },
exact: { format: { type: "time", options: { seconds: true } } },
}Results
| Typed | seconds | Result |
|---|---|---|
1430 | false | 14:30 |
143055 | true | 14:30:55 |
Things to know
- Pair with the
timevalidator (time: true) for validation.