mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-16 04:02:15 +01:00
make sure that 0 duration entries are shown correctly in calendar
This commit is contained in:
@@ -119,10 +119,17 @@ const events = computed(() => {
|
|||||||
const backgroundColor = chroma.mix(baseColor, themeBackground, 0.65, 'lab').hex();
|
const backgroundColor = chroma.mix(baseColor, themeBackground, 0.65, 'lab').hex();
|
||||||
const borderColor = chroma.mix(baseColor, themeBackground, 0.5, '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 {
|
return {
|
||||||
id: timeEntry.id,
|
id: timeEntry.id,
|
||||||
start: getLocalizedDayJs(timeEntry.start).format(),
|
start: startTime.format(),
|
||||||
end: getLocalizedDayJs(timeEntry.end!).format(),
|
end: endTime.format(),
|
||||||
title,
|
title,
|
||||||
backgroundColor,
|
backgroundColor,
|
||||||
borderColor,
|
borderColor,
|
||||||
|
|||||||
Reference in New Issue
Block a user