Fixed events from next month not appearing

This commit is contained in:
Alexis
2024-04-03 19:00:43 +02:00
parent c26bc80c69
commit 253a548f7d
2 changed files with 7 additions and 1 deletions

View File

@@ -43,6 +43,9 @@ const isDefaultDate = computed(() => {
<ul
v-if="eventsForTheDay.length > 0"
class="absolute top-12 bottom-2 inset-x-2 grid auto-rows-min gap-1"
:class="{
'opacity-50': props.faded
}"
>
<li v-for="event in eventsForTheDay" :key="event.title" class="grid">
<CalendarEvent :event />

View File

@@ -92,7 +92,10 @@ export const useCalendarEvents = defineStore('calendar-events', () => {
function shouldEventBeDisplayed(event: CalendarEvent): boolean {
switch (currentConfig.viewType) {
case 'month':
return event.date.month === Number(currentDate.currentMonth)
return (
event.date.month === Number(currentDate.currentMonth) ||
(event.date.month === Number(currentDate.currentMonth) + 1 && event.date.day <= 8) // This is to allow leap events from appearing on the last 8 tiles
)
case 'year':
return event.date.year === Number(currentDate.currentYear)