diff --git a/frontend/components/DatePicker.vue b/frontend/components/DatePicker.vue index 2a97b2c..2b34d8e 100644 --- a/frontend/components/DatePicker.vue +++ b/frontend/components/DatePicker.vue @@ -27,6 +27,11 @@ const date = computed({ } }) +const selectToday = () => { + emit('update:model-value', new Date()) + emit('close') +} + const attrs = [{ key: 'today', highlight: { @@ -37,18 +42,31 @@ const attrs = [{ \ No newline at end of file +
+ + +
+ +
+
+ diff --git a/frontend/components/PublicDynamicForm.vue b/frontend/components/PublicDynamicForm.vue index eebf0a6..6777aae 100644 --- a/frontend/components/PublicDynamicForm.vue +++ b/frontend/components/PublicDynamicForm.vue @@ -102,6 +102,10 @@ const currentUnit = computed(() => { const selectedService = data.value.services?.find(s => s.id === form.value.service) return selectedService?.unitSymbol || data.value?.units?.[0]?.symbol || 'h' }) + +const setDeliveryDateToToday = () => { + form.value.deliveryDate = dayjs().format('YYYY-MM-DD') +} - \ No newline at end of file + diff --git a/frontend/components/StaffTimeEntryModal.vue b/frontend/components/StaffTimeEntryModal.vue index da5e4df..976844c 100644 --- a/frontend/components/StaffTimeEntryModal.vue +++ b/frontend/components/StaffTimeEntryModal.vue @@ -50,6 +50,9 @@ const isOpen = computed({ const toDateStr = (dateStr: string) => dateStr ? $dayjs(dateStr).format('YYYY-MM-DD') : '' const toTimeStr = (dateStr: string) => dateStr ? $dayjs(dateStr).format('HH:mm') : '' +const setDateFieldToToday = (field: 'start_date' | 'end_date') => { + state[field] = $dayjs().format('YYYY-MM-DD') +} watch(() => props.entry, (newVal) => { if (newVal) { @@ -140,7 +143,10 @@ async function onSubmit(event: FormSubmitEvent) {
- +
+ + +
@@ -149,7 +155,10 @@ async function onSubmit(event: FormSubmitEvent) {
- +
+ + +
@@ -168,4 +177,4 @@ async function onSubmit(event: FormSubmitEvent) { - \ No newline at end of file + diff --git a/frontend/pages/createDocument/serialInvoice.vue b/frontend/pages/createDocument/serialInvoice.vue index bf00716..ebb59ae 100644 --- a/frontend/pages/createDocument/serialInvoice.vue +++ b/frontend/pages/createDocument/serialInvoice.vue @@ -152,7 +152,10 @@
- +
+ + +
@@ -303,6 +306,10 @@ const isExecuting = ref(false) const modalSearch = ref("") // NEU: Suchstring für das Modal const selectedExecutionIntervall = ref("all") +const setExecutionDateToToday = () => { + executionDate.value = dayjs().format('YYYY-MM-DD') +} + // --- SerialExecutions State --- const showExecutionsSlideover = ref(false) const executionItems = ref([]) diff --git a/frontend/pages/staff/profiles/[id].vue b/frontend/pages/staff/profiles/[id].vue index 1735daa..262966e 100644 --- a/frontend/pages/staff/profiles/[id].vue +++ b/frontend/pages/staff/profiles/[id].vue @@ -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) - +
+ + +
@@ -215,7 +231,10 @@ onMounted(fetchProfile) - +
+ + +