BUG: Fix for concatinating date range in calendar month mode

This commit is contained in:
Ivymaster
2026-07-30 17:24:44 +02:00
parent 4bc858dc48
commit bb6dfd4d64
2 changed files with 6 additions and 13 deletions
+3 -12
View File
@@ -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);
}
+3 -1
View File
@@ -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,