feat(ShowEnvelope): Logik zur Überprüfung des E-Mail-Formats hinzugefügt. Zeigt eine Fehlermeldung, wenn das Format falsch ist.

This commit is contained in:
Developer 02 2024-10-10 21:56:32 +02:00
parent cfd08602ab
commit f31ece3a59

View File

@ -159,6 +159,16 @@
const receiverMail_value = receiverMail.value;
const dateValid_value = dateValid.value;
//check email
if (!dateValid.classList.contains('is-invalid')) {
Swal.fire({
icon: "error",
title: "Falsche Email",
text: "Die E-Mail-Adresse ist ungültig. Bitte verwenden Sie das richtige Format, z. B.: user@mail.com."
});
return;
}
//check the date
const tomorrow = new Date(Date.now() + 86400000);
if (new Date(dateValid_value) < tomorrow) {