diff --git a/public/js/components/Cis/LvPlan/LvPlan.js b/public/js/components/Cis/LvPlan/LvPlan.js index 001b46f7c..cdb2c38c1 100644 --- a/public/js/components/Cis/LvPlan/LvPlan.js +++ b/public/js/components/Cis/LvPlan/LvPlan.js @@ -43,13 +43,6 @@ export default { }, currentDay: this.propsViewData?.focus_date, calendarMode: this.propsViewData?.mode ?? DEFAULT_MODE_LVPLAN, - backgrounds: [ - { - class: 'background-past', - end: now, - label: now.startOf('minute').toISOTime({ suppressSeconds: true, includeOffset: false }) - } - ], studiensemester_kurzbz: null, studiensemester_start: null, studiensemester_ende: null, @@ -57,6 +50,25 @@ export default { }; }, computed:{ + backgrounds() { + let now = luxon.DateTime.now().setZone(this.viewData.timezone); + + if (this.calendarMode == 'Month') + return [ + { + class: 'background-past', + end: now.startOf('day') + } + ]; + + return [ + { + class: 'background-past', + end: now, + label: now.startOf('minute').toISOTime({ suppressSeconds: true, includeOffset: false }) + } + ]; + }, downloadLinks() { if (!this.studiensemester_start || !this.studiensemester_ende || !this.uid) return false; @@ -82,7 +94,7 @@ export default { { title: "ical1", icon: 'fa-regular fa-calendar', link: download_link + '&format=ical&version=1&target=ical' }, { title: "ical2", icon: 'fa-regular fa-calendar', link: download_link + '&format=ical&version=2&target=ical' } ]; - }, + } }, methods: { eventStyle(event) { diff --git a/public/js/components/Cis/Mylv/RoomInformation.js b/public/js/components/Cis/Mylv/RoomInformation.js index 114295464..ac02a9d51 100644 --- a/public/js/components/Cis/Mylv/RoomInformation.js +++ b/public/js/components/Cis/Mylv/RoomInformation.js @@ -23,7 +23,6 @@ export default { propsViewData: Object }, data() { - const now = luxon.DateTime.now().setZone(this.viewData.timezone); return { modes: { day: Vue.markRaw(ModeDay), @@ -41,14 +40,28 @@ export default { } }, currentDay: this.propsViewData?.focus_date, - calendarMode: this.propsViewData?.mode ?? DEFAULT_MODE_RAUMINFO, - backgrounds: [ + calendarMode: this.propsViewData?.mode ?? DEFAULT_MODE_RAUMINFO + } + }, + computed: { + backgrounds() { + let now = luxon.DateTime.now().setZone(this.viewData.timezone); + + if (this.calendarMode == 'Month') + return [ + { + class: 'background-past', + end: now.startOf('day') + } + ]; + + return [ { class: 'background-past', end: now, label: now.startOf('minute').toISOTime({ suppressSeconds: true, includeOffset: false }) } - ] + ]; } }, methods:{