We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 42328ef + 6d7b9d6 commit 6803369Copy full SHA for 6803369
src/builder/date.ts
@@ -10,7 +10,7 @@ export function buildDateArbitrary(schema: UnknownValibotSchema, path: string) {
10
const pipes = "pipe" in schema ? schema.pipe : undefined;
11
12
if (!pipes || !Array.isArray(pipes)) {
13
- return fc.date();
+ return fc.date({ noInvalidDate: true });
14
}
15
16
for (const pipe of pipes.filter((pipe) => pipe.kind === "validation")) {
@@ -44,7 +44,9 @@ export function buildDateArbitrary(schema: UnknownValibotSchema, path: string) {
44
45
46
47
- const constraints: { min?: Date; max?: Date } = {};
+ const constraints: { min?: Date; max?: Date; noInvalidDate?: boolean } = {
48
+ noInvalidDate: true,
49
+ };
50
51
if (minValue instanceof Date) {
52
constraints.min = minValue;
0 commit comments