From 8ca5849b14cceeb4fd5a13aaaf99e9c4ba76c61c Mon Sep 17 00:00:00 2001 From: chfhtw Date: Wed, 8 Apr 2026 09:45:08 +0200 Subject: [PATCH] get timezone inside the components that require it --- public/js/components/Calendar/Base/DragAndDrop.js | 3 ++- public/js/components/Calendar/LvPlan.js | 5 +---- public/js/components/Calendar/Widget.js | 8 +++----- public/js/components/Cis/LvPlan/Lehrveranstaltung.js | 3 +-- public/js/components/Cis/LvPlan/LvPlan.js | 6 ++---- public/js/components/Cis/LvPlan/Personal.js | 5 ++--- public/js/components/Cis/Mylv/RoomInformation.js | 3 +-- public/js/components/Dashboard/Dashboard.js | 5 ++--- public/js/components/DashboardWidget/LvPlan.js | 5 +---- 9 files changed, 15 insertions(+), 28 deletions(-) diff --git a/public/js/components/Calendar/Base/DragAndDrop.js b/public/js/components/Calendar/Base/DragAndDrop.js index 631a792a8..fb6cb1848 100644 --- a/public/js/components/Calendar/Base/DragAndDrop.js +++ b/public/js/components/Calendar/Base/DragAndDrop.js @@ -20,7 +20,8 @@ export default { }, inject: { mode: "mode", - dropableEvents: "dropableEvents" + dropableEvents: "dropableEvents", + timezone: "timezone" }, props: { events: Array, diff --git a/public/js/components/Calendar/LvPlan.js b/public/js/components/Calendar/LvPlan.js index 3bd4fdafb..21dd7e95d 100644 --- a/public/js/components/Calendar/LvPlan.js +++ b/public/js/components/Calendar/LvPlan.js @@ -15,10 +15,6 @@ export default { FhcCalendar }, props: { - timezone: { - type: String, - required: true - }, date: { type: [Date, String, Number, luxon.DateTime], default: luxon.DateTime.local() @@ -39,6 +35,7 @@ export default { ], data() { return { + timezone: FHC_JS_DATA_STORAGE_OBJECT.timezone, modes: { day: Vue.markRaw(ModeDay), week: Vue.markRaw(ModeWeek), diff --git a/public/js/components/Calendar/Widget.js b/public/js/components/Calendar/Widget.js index b08c48acb..54109268e 100644 --- a/public/js/components/Calendar/Widget.js +++ b/public/js/components/Calendar/Widget.js @@ -11,18 +11,16 @@ export default { FhcCalendar }, props: { - timezone: { - type: String, - required: true - }, getPromiseFunc: { type: Function, required: true } }, data() { + const timezone = FHC_JS_DATA_STORAGE_OBJECT.timezone; return { - now: luxon.DateTime.now().setZone(this.timezone), + timezone, + now: luxon.DateTime.now().setZone(timezone), modes: { list: Vue.markRaw(ModeList) }, diff --git a/public/js/components/Cis/LvPlan/Lehrveranstaltung.js b/public/js/components/Cis/LvPlan/Lehrveranstaltung.js index 4364a5df4..1e74ad93a 100644 --- a/public/js/components/Cis/LvPlan/Lehrveranstaltung.js +++ b/public/js/components/Cis/LvPlan/Lehrveranstaltung.js @@ -22,7 +22,7 @@ export default { computed:{ currentDay() { if (!this.propsViewData?.focus_date || isNaN(new Date(this.propsViewData?.focus_date))) - return luxon.DateTime.now().setZone(this.viewData.timezone).toISODate(); + return luxon.DateTime.now().setZone(FHC_JS_DATA_STORAGE_OBJECT.timezone).toISODate(); return this.propsViewData?.focus_date; }, currentMode() { @@ -95,7 +95,6 @@ export default { this.editMode), - widgetsSetup: Vue.computed(() => this.widgetsSetup), - timezone: Vue.computed(() => this.viewData.timezone) + widgetsSetup: Vue.computed(() => this.widgetsSetup) } }, methods: { diff --git a/public/js/components/DashboardWidget/LvPlan.js b/public/js/components/DashboardWidget/LvPlan.js index c82db2e0c..9000ff9c3 100644 --- a/public/js/components/DashboardWidget/LvPlan.js +++ b/public/js/components/DashboardWidget/LvPlan.js @@ -11,9 +11,6 @@ export default { mixins: [ AbstractWidget ], - inject: [ - "timezone" - ], methods: { getPromiseFunc(start, end) { return [ @@ -27,6 +24,6 @@ export default { }, template: /*html*/`
- +
` } \ No newline at end of file