mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-10-12 15:04:04 +00:00
BUG: Fix for concatinating date range in calendar month mode
This commit is contained in:
@@ -27,18 +27,9 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
range() {
|
range() {
|
||||||
let first = this.focusDate.startOf('month').startOf('week', { useLocaleWeeks: true });
|
const targetDate = this.focusDate.plus({ months: this.rangeOffset });
|
||||||
let last = first.plus({ days: 41 }).endOf('day'); // NOTE(chris): 6 weeks minus 1 day
|
const first = targetDate.startOf('month').startOf('week', { useLocaleWeeks: true });
|
||||||
|
const 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');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return luxon.Interval.fromDateTimes(first, last);
|
return luxon.Interval.fromDateTimes(first, last);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -167,7 +167,9 @@ export default {
|
|||||||
},
|
},
|
||||||
setup(props, context) {
|
setup(props, context) {
|
||||||
const rangeInterval = Vue.ref(null);
|
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(
|
const { events, lv, reset } = useEventLoader(
|
||||||
rangeInterval,
|
rangeInterval,
|
||||||
|
|||||||
Reference in New Issue
Block a user