fix min birthday date and error message (#9)
All checks were successful
delpoy / build-and-deploy (push) Successful in 45s

This commit is contained in:
bytedream 2023-11-30 20:27:56 +01:00
parent 971ca4bc75
commit 26aaf8c677

View File

@ -39,13 +39,14 @@
async function sendRegister() {
// eslint-disable-next-line no-async-promise-executor
registerRequest = new Promise(async (resolve, reject) => {
console.log(birthdayInput.valueAsDate);
if (
birthdayInput.valueAsDate ||
new Date() > new Date(Date.now() - 1000 * 60 * 60 * 24 * 365 * 6)
(birthdayInput.valueAsDate || new Date()) >
new Date(Date.now() - 1000 * 60 * 60 * 24 * 365 * 6)
) {
reject(
Error(
'Bitte gib deinen vollständigen Geburtstag und die korrekte Jahreszahl an. Du musst mindestens 6 Jahre alt sein.'
'Bitte gib Deinen vollständigen Geburtstag und die korrekte Jahreszahl an. Du musst mindestens 6 Jahre alt sein.\n'
)
);
return;