fix invalid datetime error on team create

This commit is contained in:
bytedream 2025-05-18 21:10:55 +02:00
parent 0ff3b817d8
commit 560bf04b6c
3 changed files with 6 additions and 6 deletions

View File

@ -9,7 +9,7 @@ export const team = {
input: z.object({
name: z.string(),
color: z.string(),
lastJoined: z.string().datetime().nullable(),
lastJoined: z.string().datetime({ local: true }).nullable(),
memberOne: z.object({
id: z.number().nullish(),
username: z.string()

View File

@ -29,7 +29,7 @@
// states
let name = $state<string | null>(team?.name ?? null);
let color = $state<string | null>(team?.color ?? null);
let color = $state<string | null>(team?.color ?? '#000000');
let lastJoined = $state<string | null>(team?.lastJoined ?? null);
let memberOne = $state<Team['memberOne']>(team?.memberOne ?? ({ username: null } as unknown as Team['memberOne']));
let memberTwo = $state<Team['memberOne']>(team?.memberTwo ?? ({ username: null } as unknown as Team['memberOne']));
@ -74,15 +74,15 @@
<h3 class="text-xl font-geist font-bold">{popupTitle}</h3>
<div class="w-full flex flex-col">
<div class="grid grid-cols-2 gap-4">
<Input type="color" label="Farbe" bind:value={color} />
<Input type="text" label="Name" bind:value={name} />
<Input type="color" label="Farbe" bind:value={color} required />
<Input type="text" label="Name" bind:value={name} required />
</div>
<div class="grid grid-cols-2 gap-4">
<UserSearch label="Spieler 1" bind:value={memberOne.username} required mustMatch />
<UserSearch label="Spieler 2" bind:value={memberTwo.username} required />
</div>
<div class="grid grid-cols-2 gap-4">
<Input type="date" label="Zuletzt gejoined" bind:value={lastJoined}></Input>
<Input type="datetime-local" label="Zuletzt gejoined" bind:value={lastJoined}></Input>
</div>
</div>
<div>

View File

@ -3,7 +3,7 @@
interface Props {
id?: string;
type?: 'color' | 'date' | 'tel' | 'text' | 'email';
type?: 'color' | 'date' | 'datetime-local' | 'tel' | 'text' | 'email';
value?: string | null;
label?: string;
required?: boolean;