fix min birthday date and error message (#9)
All checks were successful
delpoy / build-and-deploy (push) Successful in 45s
All checks were successful
delpoy / build-and-deploy (push) Successful in 45s
This commit is contained in:
parent
971ca4bc75
commit
26aaf8c677
@ -39,13 +39,14 @@
|
|||||||
async function sendRegister() {
|
async function sendRegister() {
|
||||||
// eslint-disable-next-line no-async-promise-executor
|
// eslint-disable-next-line no-async-promise-executor
|
||||||
registerRequest = new Promise(async (resolve, reject) => {
|
registerRequest = new Promise(async (resolve, reject) => {
|
||||||
|
console.log(birthdayInput.valueAsDate);
|
||||||
if (
|
if (
|
||||||
birthdayInput.valueAsDate ||
|
(birthdayInput.valueAsDate || new Date()) >
|
||||||
new Date() > new Date(Date.now() - 1000 * 60 * 60 * 24 * 365 * 6)
|
new Date(Date.now() - 1000 * 60 * 60 * 24 * 365 * 6)
|
||||||
) {
|
) {
|
||||||
reject(
|
reject(
|
||||||
Error(
|
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;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user