Fix #138
This commit is contained in:
@@ -107,6 +107,19 @@ function recalculateWeeklyHours() {
|
||||
profile.value.weekly_working_hours = Number(total.toFixed(2))
|
||||
}
|
||||
|
||||
const getToday = () => {
|
||||
const now = new Date()
|
||||
const year = now.getFullYear()
|
||||
const month = String(now.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(now.getDate()).padStart(2, '0')
|
||||
return `${year}-${month}-${day}`
|
||||
}
|
||||
|
||||
const setProfileDate = (field: 'birthday' | 'entry_date') => {
|
||||
if (!profile.value) return
|
||||
profile.value[field] = getToday()
|
||||
}
|
||||
|
||||
const checkZip = async () => {
|
||||
const zipData = await useFunctions().useZipCheck(profile.value.address_zip)
|
||||
if (zipData) {
|
||||
@@ -190,7 +203,10 @@ onMounted(fetchProfile)
|
||||
</UFormGroup>
|
||||
|
||||
<UFormGroup label="Geburtstag">
|
||||
<UInput type="date" v-model="profile.birthday" />
|
||||
<div class="flex items-center gap-2">
|
||||
<UInput type="date" v-model="profile.birthday" class="flex-1" />
|
||||
<UButton color="gray" variant="soft" label="Heute" @click="setProfileDate('birthday')" />
|
||||
</div>
|
||||
</UFormGroup>
|
||||
</UForm>
|
||||
</UCard>
|
||||
@@ -215,7 +231,10 @@ onMounted(fetchProfile)
|
||||
</UFormGroup>
|
||||
|
||||
<UFormGroup label="Eintrittsdatum">
|
||||
<UInput type="date" v-model="profile.entry_date" />
|
||||
<div class="flex items-center gap-2">
|
||||
<UInput type="date" v-model="profile.entry_date" class="flex-1" />
|
||||
<UButton color="gray" variant="soft" label="Heute" @click="setProfileDate('entry_date')" />
|
||||
</div>
|
||||
</UFormGroup>
|
||||
|
||||
<UFormGroup label="Wöchentliche Arbeitszeit (Std)">
|
||||
|
||||
Reference in New Issue
Block a user