From a1a154caa3bd494bbb4f77cf3c7c0ef6169d01b1 Mon Sep 17 00:00:00 2001 From: Brieuc Dubois <git@bhasher.com> Date: Mon, 4 Nov 2024 11:03:38 +0200 Subject: [PATCH] Fix tutor registration --- frontend/src/routes/register/+page.svelte | 4 ---- frontend/src/routes/tutor/register/+page.svelte | 16 +++------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/frontend/src/routes/register/+page.svelte b/frontend/src/routes/register/+page.svelte index 64437b5a..7813085b 100644 --- a/frontend/src/routes/register/+page.svelte +++ b/frontend/src/routes/register/+page.svelte @@ -491,10 +491,6 @@ </div> <style lang="postcss"> - /* input:not([type='radio']) { - @apply w-full; - } */ - .label-text-alt { @apply opacity-50 ml-8; } diff --git a/frontend/src/routes/tutor/register/+page.svelte b/frontend/src/routes/tutor/register/+page.svelte index 1f841a11..9b893472 100644 --- a/frontend/src/routes/tutor/register/+page.svelte +++ b/frontend/src/routes/tutor/register/+page.svelte @@ -8,14 +8,10 @@ import { get } from 'svelte/store'; import Timeslots from '$lib/components/users/timeslots.svelte'; import User, { users } from '$lib/types/user'; - import { - getUsersAPI, - patchUserAPI, - createUserContactAPI, - getUserContactsAPI - } from '$lib/api/users'; + import { getUsersAPI, patchUserAPI, getUserContactsAPI } from '$lib/api/users'; import { Icon, Envelope, Key, UserCircle, Calendar, QuestionMarkCircle } from 'svelte-hero-icons'; import Typingtest from '$lib/components/tests/typingtest.svelte'; + import { formatToUTCDate } from '$lib/utils/date'; let current_step = 0; @@ -57,12 +53,6 @@ let calcom_link = ''; let timeslots = 0n; - $: filteredUsers = $users.filter((user) => { - if (user.availability === 0n) return false; - if (timeslots === 0n) return true; - - return user.availability & timeslots; - }); async function onRegister() { if (nickname == '' || email == '' || password == '' || confirmPassword == '') { @@ -360,7 +350,7 @@ id="birthyear" name="birthyear" required - bind:value={birthdate} + on:change={(e) => (birthdate = formatToUTCDate(new Date(e.target.value, 1, 1)))} > <option disabled selected value="">{$t('register.birthyear')}</option> {#each Array.from({ length: 82 }, (_, i) => i + 1931).reverse() as year} -- GitLab