Skip to content

Commit

Permalink
fix(VCalendar): show all days of multi-day events
Browse files Browse the repository at this point in the history
fixes #19065
  • Loading branch information
Hendrik-Mueller-Overzone committed Jan 23, 2025
1 parent bceadbe commit bd5ad73
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/vuetify/src/labs/VCalendar/VCalendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ export const VCalendar = genericComponent<VCalendarSlots>()({
color={ adapter.isSameDay(adapter.date(), day.date) ? 'primary' : undefined }
day={ day }
title={ day ? adapter.format(day.date, 'dayOfMonth') : 'NaN' }
events={ props.events?.filter(e => adapter.isSameDay(day.date, e.start) || adapter.isSameDay(day.date, e.end)) }
events={ props.events?.filter(e => adapter.isSameDay(day.date, e.start) ||
adapter.isSameDay(day.date, e.end) ||
adapter.isWithinRange(day.date, [e.start, e.end]))}
v-slots={{
event: slots.event,
}}
Expand All @@ -169,7 +171,9 @@ export const VCalendar = genericComponent<VCalendarSlots>()({
{ ...calendarDayProps }
day={ day }
dayIndex={ i }
events={ props.events?.filter(e => adapter.isSameDay(e.start, day.date) || adapter.isSameDay(e.end, day.date)) }
events={ props.events?.filter(e => adapter.isSameDay(e.start, day.date) ||
adapter.isSameDay(e.end, day.date) ||
adapter.isWithinRange(day.date, [e.start, e.end]))}
></VCalendarDay>
))
)}
Expand All @@ -182,7 +186,8 @@ export const VCalendar = genericComponent<VCalendarSlots>()({
events={
props.events?.filter(e =>
adapter.isSameDay(e.start, genDays([displayValue.value as Date], adapter.date() as Date)[0].date) ||
adapter.isSameDay(e.end, genDays([displayValue.value as Date], adapter.date() as Date)[0].date)
adapter.isSameDay(e.end, genDays([displayValue.value as Date], adapter.date() as Date)[0].date) ||
adapter.isWithinRange(genDays([displayValue.value as Date], adapter.date() as Date)[0].date, [e.start, e.end])
)
}
></VCalendarDay>
Expand Down

0 comments on commit bd5ad73

Please sign in to comment.