fix datepicker for report create/update, fix public_until update

This commit is contained in:
Gregor Vostrak
2025-06-24 16:57:12 +02:00
parent 915204f7a6
commit a45c8a89f6
5 changed files with 66 additions and 13 deletions

View File

@@ -30,7 +30,9 @@ const handleChange = (date: DateValue | undefined) => {
return;
}
const dayjs = getLocalizedDayJs(model.value);
const dayjs = model.value
? getLocalizedDayJs(model.value)
: getLocalizedDayJs();
model.value = dayjs
.year(date.year)
.month(date.month - 1) // CalendarDate uses 1-based months
@@ -62,12 +64,15 @@ const organization = inject<ComputedRef<Organization>>('organization');
]"
:tabindex="tabindex">
<CalendarIcon
:class="[
size === 'xs' ? 'h-3 w-3' :
size === 'sm' ? 'h-3 w-3' :
size === 'lg' ? 'h-4.5 w-4.5' :
'h-4 w-4'
]" />
:class="[
size === 'xs'
? 'h-3 w-3'
: size === 'sm'
? 'h-3 w-3'
: size === 'lg'
? 'h-4.5 w-4.5'
: 'h-4 w-4',
]" />
<span class="text-center">
{{
model