mirror of
https://github.com/Since-3/Kuma.git
synced 2026-10-12 21:41:17 +00:00
see comment
This commit is contained in:
parent
7aec673c99
commit
226d4b8c26
1 changed files with 16 additions and 11 deletions
|
|
@ -30,17 +30,22 @@ export const userRegisterSchema = z
|
|||
"Passwort muss mindestens 8 Zeichen haben, Großbuchstaben, Kleinbuchstaben, Nummer und ein spezielles Zeichen beinhalten"
|
||||
),
|
||||
passwordConfirm: z.string(),
|
||||
birthday: z.string().refine(
|
||||
(date) => {
|
||||
const selectedDate = new Date(date);
|
||||
const today = new Date();
|
||||
today.setHours(0, 0, 0, 0);
|
||||
return selectedDate <= today;
|
||||
},
|
||||
{
|
||||
message: "Geburtsdatum darf nicht in der Zukunft liegen",
|
||||
}
|
||||
),
|
||||
birthday: z.iso
|
||||
.date({
|
||||
message: "Ungültiges Datumsformat",
|
||||
})
|
||||
.refine(
|
||||
(date) => {
|
||||
const selectedDate = new Date(date);
|
||||
selectedDate.setHours(0, 0, 0, 0);
|
||||
const today = new Date();
|
||||
today.setHours(0, 0, 0, 0);
|
||||
return selectedDate <= today;
|
||||
},
|
||||
{
|
||||
message: "Geburtsdatum darf nicht in der Zukunft liegen",
|
||||
}
|
||||
),
|
||||
plz: z.string().min(1, "PLZ erforderlich"),
|
||||
place: z.string().min(1, "Wohnort erforderlich"),
|
||||
street: z.string().min(1, "Straße erforderlich"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue