This commit is contained in:
Leo Vasanko 2025-08-23 18:38:25 -06:00
parent 0a80d364f1
commit b4b14a695b

View File

@ -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)