Simplified CalendarStore
This commit is contained in:
@@ -20,6 +20,7 @@ import {
|
||||
} from '@/utils/date'
|
||||
import { toLocalString, fromLocalString, DEFAULT_TZ } from '@/utils/date'
|
||||
import { addDays, differenceInCalendarDays } from 'date-fns'
|
||||
import { getHolidayForDate } from '@/utils/holidays'
|
||||
|
||||
const calendarStore = useCalendarStore()
|
||||
const viewport = ref(null)
|
||||
@@ -232,7 +233,12 @@ function createWeek(virtualWeek) {
|
||||
}
|
||||
|
||||
// Get holiday info once per day
|
||||
const holiday = calendarStore.getHolidayForDate(dateStr)
|
||||
// Ensure holidays initialized lazily
|
||||
let holiday = null
|
||||
if (calendarStore.config.holidays.enabled) {
|
||||
calendarStore._ensureHolidaysInitialized?.()
|
||||
holiday = getHolidayForDate(dateStr)
|
||||
}
|
||||
|
||||
days.push({
|
||||
date: dateStr,
|
||||
|
||||
Reference in New Issue
Block a user