make sure that 0 duration entries are shown correctly in calendar

This commit is contained in:
Gregor Vostrak
2025-09-02 14:44:53 +02:00
parent 62f5986b5f
commit 7d2bb820ee

View File

@@ -119,10 +119,17 @@ const events = computed(() => {
const backgroundColor = chroma.mix(baseColor, themeBackground, 0.65, 'lab').hex();
const borderColor = chroma.mix(baseColor, themeBackground, 0.5, 'lab').hex();
// For 0-duration events, display them with minimum visual duration but preserve actual duration
const startTime = getLocalizedDayJs(timeEntry.start);
const endTime =
duration === 0
? startTime.add(1, 'second') // Show as 1 second for minimal visibility
: getLocalizedDayJs(timeEntry.end!);
return {
id: timeEntry.id,
start: getLocalizedDayJs(timeEntry.start).format(),
end: getLocalizedDayJs(timeEntry.end!).format(),
start: startTime.format(),
end: endTime.format(),
title,
backgroundColor,
borderColor,