Date
Example
Section titled “Example”import * as p from '@vbudovski/paseri';
const schema = p.date();const data = new Date(2020, 0, 1);
const result = schema.safeParse(data);if (result.ok) { // result.value typed as `Date`.}
Playground
Section titled “Playground”Validators
Section titled “Validators”Date on or after value
.
p.string().min(new Date(2020, 0, 1));
Date on or before value
.
p.string().max(new Date(2020, 0, 1));