Skip to content

Commit 47b778f

Browse files
committed
make sure that 0 duration entries are shown correctly in calendar
1 parent 85d69f1 commit 47b778f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

resources/js/packages/ui/src/FullCalendar/TimeEntryCalendar.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,17 @@ const events = computed(() => {
119119
const backgroundColor = chroma.mix(baseColor, themeBackground, 0.65, 'lab').hex();
120120
const borderColor = chroma.mix(baseColor, themeBackground, 0.5, 'lab').hex();
121121
122+
// For 0-duration events, display them with minimum visual duration but preserve actual duration
123+
const startTime = getLocalizedDayJs(timeEntry.start);
124+
const endTime =
125+
duration === 0
126+
? startTime.add(1, 'second') // Show as 1 second for minimal visibility
127+
: getLocalizedDayJs(timeEntry.end!);
128+
122129
return {
123130
id: timeEntry.id,
124-
start: getLocalizedDayJs(timeEntry.start).format(),
125-
end: getLocalizedDayJs(timeEntry.end!).format(),
131+
start: startTime.format(),
132+
end: endTime.format(),
126133
title,
127134
backgroundColor,
128135
borderColor,

0 commit comments

Comments
 (0)