A little better but still broken. I need easier tasks for a while.
This commit is contained in:
1 parent
02442f5135
commit
8caaf33cb9
4 files changed
+345
-216
No files matched your search
@@ -3,7 +3,7 @@ import { useCalendarStore } from '@/stores/CalendarStore'
|
||||
import { ref, computed, watch, onMounted, onUnmounted, nextTick } from 'vue'
|
||||
import WeekdaySelector from './WeekdaySelector.vue'
|
||||
import Numeric from './Numeric.vue'
|
||||
import { addDaysStr } from '@/utils/date'
|
||||
import { addDaysStr, getMondayOfISOWeek } from '@/utils/date'
|
||||
|
||||
const props = defineProps({
|
||||
selection: { type: Object, default: () => ({ startDate: null, dayCount: 0 }) },
|
||||
@@ -173,11 +173,9 @@ function openEditDialog(payload) {
|
||||
// Count valid repeat occurrences (pattern + interval alignment) AFTER the base span
|
||||
const interval = event.repeatInterval || 1
|
||||
const WEEK_MS = 7 * 86400000
|
||||
const baseBlockStart = new Date(baseStart)
|
||||
baseBlockStart.setDate(baseStart.getDate() - baseStart.getDay())
|
||||
const baseBlockStart = getMondayOfISOWeek(baseStart)
|
||||
function isAligned(d) {
|
||||
const blk = new Date(d)
|
||||
blk.setDate(d.getDate() - d.getDay())
|
||||
const blk = getMondayOfISOWeek(d)
|
||||
const diff = Math.floor((blk - baseBlockStart) / WEEK_MS)
|
||||
return diff % interval === 0
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user