[FIX] correct zod model for dates and times

This commit is contained in:
Edouard DUPIN 2024-05-09 00:10:04 +02:00
parent f06b5a1edc
commit 94e5603380

View File

@ -269,14 +269,14 @@ public class DataFactoryZod {
"zod.number()", false), true); "zod.number()", false), true);
previous.add(new ClassElement(new Class<?>[] { Instant.class }, "ZodInstant", "Instant", "isInstant", previous.add(new ClassElement(new Class<?>[] { Instant.class }, "ZodInstant", "Instant", "isInstant",
"zod.string()", false), true); "zod.string()", false), true);
previous.add(new ClassElement(new Class<?>[] { Date.class }, "ZodDate", "Date", "isDate", "zod.date()", false), previous.add(new ClassElement(new Class<?>[] { Date.class }, "ZodDate", "Date", "isDate",
true); "zod.string().datetime({ precision: 3 })", false), true);
previous.add(new ClassElement(new Class<?>[] { Timestamp.class }, "ZodTimestamp", "Timestamp", "isTimestamp", previous.add(new ClassElement(new Class<?>[] { Timestamp.class }, "ZodTimestamp", "Timestamp", "isTimestamp",
"zod.date()", false), true); "zod.string().datetime({ precision: 3 })", false), true);
previous.add(new ClassElement(new Class<?>[] { LocalDate.class }, "ZodLocalDate", "LocalDate", "isLocalDate", previous.add(new ClassElement(new Class<?>[] { LocalDate.class }, "ZodLocalDate", "LocalDate", "isLocalDate",
"zod.date()", false), true); "zod.string().date()", false), true);
previous.add(new ClassElement(new Class<?>[] { LocalTime.class }, "ZodLocalTime", "LocalTime", "isLocalTime", previous.add(new ClassElement(new Class<?>[] { LocalTime.class }, "ZodLocalTime", "LocalTime", "isLocalTime",
"zod.date()", false), true); "zod.string().time()", false), true);
return previous; return previous;
} }