Dates
In this example, all sorts of date schemas are validated on the client and on the server.
const schema = z.object({
mandatory: z.date(),
optional: z.date().optional(),
nullable: z.date().nullable(),
default: z.date().default(new Date()),
})
const mutation = applySchema(schema)(async (values) => values)
export const action = async ({ request }: Route.ActionArgs) =>
formAction({ request, schema, mutation })
export default () => <SchemaForm schema={schema} />