From 989ce6d707a7ab3ab9191f7b1aea7b78614fe6bf Mon Sep 17 00:00:00 2001 From: adisposkofh Date: Tue, 1 Sep 2026 13:11:43 +0200 Subject: [PATCH] limit lv plan range view to personal lv plan page --- public/js/components/Calendar/LvPlan.js | 32 ++++++--------------- public/js/components/Cis/LvPlan/MyLvPlan.js | 1 + 2 files changed, 9 insertions(+), 24 deletions(-) diff --git a/public/js/components/Calendar/LvPlan.js b/public/js/components/Calendar/LvPlan.js index b629b3dae..1ac736716 100644 --- a/public/js/components/Calendar/LvPlan.js +++ b/public/js/components/Calendar/LvPlan.js @@ -36,7 +36,11 @@ export default { getPromiseFunc: { type: Function, required: true - } + }, + shouldIncludeRangeMode: { + type: Boolean, + default: false, + }, }, provide() { return { @@ -83,28 +87,6 @@ export default { end: now.startOf('day') } ]; - } else if (this.mode == 'Range') { - // todo: remove - return []; - const start = luxon.DateTime.fromISO(this.$props.date); - const end = start.plus({days: this.rangeLength}); - let backgrounds = []; - - let saturdayOffset = 6 - start.weekday; - let saturday = start.plus({days: saturdayOffset}); - while (saturday.ts < end.ts) { - backgrounds.push( - { - class: "background-weekend", - start: saturday.startOf("day"), - end: saturday.plus({days: 1}).endOf("day"), - } - ); - - saturday = saturday.plus({days: 7}); - } - - return backgrounds; } else { return [ { @@ -122,7 +104,9 @@ export default { }; if (!this.isMobile) { modes.week = Vue.markRaw(ModeWeek); - modes.range = Vue.markRaw(ModeRange); + if (this.$props.shouldIncludeRangeMode) { + modes.range = Vue.markRaw(ModeRange); + } } else { modes.list = Vue.markRaw(ModeList); } diff --git a/public/js/components/Cis/LvPlan/MyLvPlan.js b/public/js/components/Cis/LvPlan/MyLvPlan.js index 7d1593230..1f3cdfbbc 100644 --- a/public/js/components/Cis/LvPlan/MyLvPlan.js +++ b/public/js/components/Cis/LvPlan/MyLvPlan.js @@ -193,6 +193,7 @@ export default { :get-promise-func="getPromiseFunc" :date="currentDay" :mode="currentMode" + :shouldIncludeRangeMode="true" @update:date="handleChangeDate" @update:mode="handleChangeMode" @update:range="updateRange"