From 094a3ed56a585f85e3c488bf0513090d6cd3c88b Mon Sep 17 00:00:00 2001 From: SimonGschnell Date: Mon, 11 Nov 2024 15:46:09 +0100 Subject: [PATCH] feature(Calendar): scrolls to the first event of the day if the prop scrollTime is passed to Calendar component --- public/js/apps/Cis/Stundenplan.js | 20 ++++++++++++++++++-- public/js/components/Calendar/Calendar.js | 17 ++++++++++++++++- public/js/components/Calendar/Day/Page.js | 2 +- public/js/components/Calendar/Week/Page.js | 7 ++++--- 4 files changed, 39 insertions(+), 7 deletions(-) diff --git a/public/js/apps/Cis/Stundenplan.js b/public/js/apps/Cis/Stundenplan.js index cb019952c..6835dc3a3 100644 --- a/public/js/apps/Cis/Stundenplan.js +++ b/public/js/apps/Cis/Stundenplan.js @@ -32,6 +32,17 @@ const app = Vue.createApp({ monthLastDay: function () { return this.calendarDateToString(this.calendarDate.cdLastDayOfCalendarMonth); }, + // returns the hour of the earliest event + eventsBeginnTime: function(){ + if(this.events && Array.isArray(this.events) && this.events.length > 0) + { + return parseInt(this.events.sort((a, b) => parseInt(a.beginn) - parseInt(b.beginn))[0].beginn); + } + else + { + return null; + } + }, }, methods:{ selectDay: function(day){ @@ -98,15 +109,20 @@ const app = Vue.createApp({ }); }, }, - created(){ + created() + { this.loadEvents(); + }, + mounted() + { + }, //TODO: Stundenplan phrase template:/*html*/`

Stundenplan


- +