Remove the 14 day selection limit for creating or modifying events.

This commit is contained in:
Leo Vasanko
2025-09-24 16:09:50 -06:00
parent 9b2354fd91
commit 31c5551535
2 changed files with 2 additions and 14 deletions

View File

@@ -258,7 +258,6 @@ watch(
function startDrag(dateStr) {
dateStr = normalizeDate(dateStr)
if (calendarStore.config.select_days === 0) return
isDragging.value = true
dragAnchor.value = dateStr
selection.value = { startDate: dateStr, dayCount: 1 }
@@ -371,23 +370,13 @@ function getDateFromCoordinates(clientX, clientY) {
}
function calculateSelection(anchorStr, otherStr) {
const limit = calendarStore.config.select_days
const anchorDate = fromLocalString(anchorStr, DEFAULT_TZ)
const otherDate = fromLocalString(otherStr, DEFAULT_TZ)
const forward = otherDate >= anchorDate
const span = daysInclusive(anchorStr, otherStr)
if (span <= limit) {
const startDate = forward ? anchorStr : otherStr
return { startDate, dayCount: span }
}
if (forward) {
return { startDate: anchorStr, dayCount: limit }
} else {
const startDate = addDaysStr(anchorStr, -(limit - 1), DEFAULT_TZ)
return { startDate, dayCount: limit }
}
const startDate = forward ? anchorStr : otherStr
return { startDate, dayCount: span }
}
onMounted(() => {

View File

@@ -23,7 +23,6 @@ export const useCalendarStore = defineStore('calendar', {
_holidayConfigSignature: null,
_holidaysInitialized: false,
config: {
select_days: 14,
first_day: 1,
holidays: {
enabled: true,