diff --git a/src/stores/CalendarStore.js b/src/stores/CalendarStore.js index d7fc5e5..8f44081 100644 --- a/src/stores/CalendarStore.js +++ b/src/stores/CalendarStore.js @@ -5,10 +5,6 @@ import { getLocaleWeekendDays, getMondayOfISOWeek, getOccurrenceIndex, - getWeeklyOccurrenceIndex, - getMonthlyOccurrenceIndex, - getVirtualOccurrenceEndDate, - occursOnOrSpansDate, } from '@/utils/date' import { initializeHolidays, @@ -16,7 +12,6 @@ import { isHoliday, getAvailableCountries, getAvailableStates, - getHolidayConfig, } from '@/utils/holidays' const MIN_YEAR = 1900 @@ -164,23 +159,11 @@ export const useCalendarStore = defineStore('calendar', { }, getAvailableCountries() { - try { - const countries = getAvailableCountries() - return Array.isArray(countries) ? countries : ['US', 'GB', 'DE', 'FR', 'CA', 'AU'] - } catch (error) { - console.warn('Failed to get available countries:', error) - return ['US', 'GB', 'DE', 'FR', 'CA', 'AU'] - } + return getAvailableCountries() || [] }, getAvailableStates(country) { - try { - const states = getAvailableStates(country) - return Array.isArray(states) ? states : [] - } catch (error) { - console.warn('Failed to get available states for', country, error) - return [] - } + return getAvailableStates(country) || [] }, toggleHolidays() { @@ -508,10 +491,6 @@ export const useCalendarStore = defineStore('calendar', { this.deleteEvent(baseId) return } - - // We want to keep occurrences up to but NOT including the selected one - // occurrenceIndex represents the occurrence index including the base (0=base, 1=first repeat, etc.) - // To exclude the current occurrence and everything after, we keep only occurrenceIndex total occurrences const keptTotal = occurrenceIndex this._terminateRepeatSeriesAtIndex(baseId, keptTotal) }, @@ -597,13 +576,6 @@ export const useCalendarStore = defineStore('calendar', { return base.id }, - _snapshotBaseEvent(eventId) { - const ev = this.events.get(eventId) - return ev ? { ...ev } : null - }, - - // expandRepeats removed: no physical occurrence expansion - // Adjust start/end range of a base event (non-generated) and reindex occurrences setEventRange(eventId, newStartStr, newEndStr, { mode = 'auto' } = {}) { const snapshot = this.events.get(eventId)