feat: update validation message for expires_date to allow today's date
This commit is contained in:
parent
2676dc61ed
commit
c1c0ad2a2f
1 changed files with 2 additions and 2 deletions
|
|
@ -41,8 +41,8 @@ type FormProps = {
|
||||||
|
|
||||||
const Schema = z
|
const Schema = z
|
||||||
.object({
|
.object({
|
||||||
expires_date: z.date().refine((d) => isAfter(d, new Date()), {
|
expires_date: z.date().refine((d) => isAfter(d, new Date()) || d.toDateString() === new Date().toDateString(), {
|
||||||
message: "La data deve essere nel futuro",
|
message: "La data deve essere nel futuro o oggi",
|
||||||
}),
|
}),
|
||||||
expires_time: z.string(),
|
expires_time: z.string(),
|
||||||
mailType: z.enum(TemplateKeys),
|
mailType: z.enum(TemplateKeys),
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue