Added timezone to registration

This commit is contained in:
Constantin Graf
2024-03-19 18:14:26 +01:00
parent 6ecfef6bf1
commit 5a733b17aa
12 changed files with 75 additions and 5 deletions

View File

@@ -15,6 +15,7 @@ const form = useForm({
password: '',
password_confirmation: '',
terms: false,
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone ?? null,
});
const submit = () => {

View File

@@ -203,8 +203,17 @@ const page = usePage<{
<!-- Timezone -->
<div class="col-span-6 sm:col-span-4">
<InputLabel for="timezone" value="Timezone" />
<select name="timezone" id="timezone" v-model="form.timezone" class="mt-1 block w-full border-input-border bg-input-background text-white focus:border-input-border-active rounded-md shadow-sm">
<option v-for="timezone in $page.props.timezones" :value="timezone">
<select
name="timezone"
id="timezone"
v-model="form.timezone"
required
class="mt-1 block w-full border-input-border bg-input-background text-white focus:border-input-border-active rounded-md shadow-sm">
<option value="" disabled>Select a Timezone</option>
<option
v-for="timezone in $page.props.timezones"
:key="timezone"
:value="timezone">
{{ timezone }}
</option>
</select>