From bb6dfd4d642d9a233ece66761663f3903481254c Mon Sep 17 00:00:00 2001 From: Ivymaster Date: Thu, 30 Jul 2026 17:24:44 +0200 Subject: [PATCH] BUG: Fix for concatinating date range in calendar month mode --- public/js/components/Calendar/Mode/Month.js | 15 +++------------ public/js/components/Calendar/Tempus.js | 4 +++- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/public/js/components/Calendar/Mode/Month.js b/public/js/components/Calendar/Mode/Month.js index a352ccc98..2bb0d4424 100644 --- a/public/js/components/Calendar/Mode/Month.js +++ b/public/js/components/Calendar/Mode/Month.js @@ -27,18 +27,9 @@ export default { }, computed: { range() { - let first = this.focusDate.startOf('month').startOf('week', { useLocaleWeeks: true }); - let last = first.plus({ days: 41 }).endOf('day'); // NOTE(chris): 6 weeks minus 1 day - - if (this.rangeOffset != 0) { - const nextFocusDate = this.focusDate.plus({ months: this.rangeOffset}); - const nextRangeStart = nextFocusDate.startOf('month').startOf('week', { useLocaleWeeks: true }); - if (this.rangeOffset < 0) { - first = nextRangeStart; - } else { - last = nextRangeStart.plus({ days: 41 }).endOf('day'); - } - } + const targetDate = this.focusDate.plus({ months: this.rangeOffset }); + const first = targetDate.startOf('month').startOf('week', { useLocaleWeeks: true }); + const last = first.plus({ days: 41 }).endOf('day'); // NOTE(chris): 6 weeks minus 1 day return luxon.Interval.fromDateTimes(first, last); } diff --git a/public/js/components/Calendar/Tempus.js b/public/js/components/Calendar/Tempus.js index 0e096e779..c8923681f 100644 --- a/public/js/components/Calendar/Tempus.js +++ b/public/js/components/Calendar/Tempus.js @@ -167,7 +167,9 @@ export default { }, setup(props, context) { const rangeInterval = Vue.ref(null); - const preserveRequestedRange = Vue.computed(() => props.mode?.toLowerCase() === 'week'); + const preserveRequestedRange = Vue.computed(() => { + return ['week', 'month'].includes(props.mode?.toLowerCase()); + }); const { events, lv, reset } = useEventLoader( rangeInterval,