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: {
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user