Fix recurrent event splitting being broken after prior refactoring.
This commit is contained in:
@@ -289,7 +289,7 @@ export const useCalendarStore = defineStore('calendar', {
|
||||
this.notifyEventsChanged()
|
||||
},
|
||||
|
||||
splitMoveVirtualOccurrence(baseId, occurrenceDateStr, newStartStr, newEndStr) {
|
||||
splitMoveVirtualOccurrence(baseId, occurrenceDateStr, newStartStr, newEndStr, occurrenceIndex) {
|
||||
const base = this.events.get(baseId)
|
||||
if (!base || !base.recur) return
|
||||
const originalCountRaw = base.recur.count
|
||||
@@ -310,7 +310,8 @@ export const useCalendarStore = defineStore('calendar', {
|
||||
this.setEventRange(baseId, newStartStr, newEndStr, { mode: 'move', rotatePattern: true })
|
||||
return baseId
|
||||
}
|
||||
if (occurrenceDate <= baseStart) {
|
||||
// Use occurrenceIndex when provided to detect first occurrence (n == 0)
|
||||
if (occurrenceIndex === 0 || occurrenceDate.getTime() === baseStart.getTime()) {
|
||||
this.setEventRange(baseId, newStartStr, newEndStr, { mode: 'move' })
|
||||
return baseId
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user