From 57b0ae12d536fb92a5fa579fff06ef19fa95261d Mon Sep 17 00:00:00 2001 From: SimonGschnell Date: Mon, 16 Jun 2025 10:58:23 +0200 Subject: [PATCH] update(LvPlan router):changes the route parameters when changing the week in the weeks overview --- public/js/components/Calendar/Weeks.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/public/js/components/Calendar/Weeks.js b/public/js/components/Calendar/Weeks.js index 260540adb..bed39d624 100644 --- a/public/js/components/Calendar/Weeks.js +++ b/public/js/components/Calendar/Weeks.js @@ -9,7 +9,8 @@ export default { ], inject: [ 'size', - 'focusDate' + 'focusDate', + 'mode', ], props: { header: { @@ -30,6 +31,20 @@ export default { // TODO(chris): test is there a week jump on year select? => yes there is if the same month/day are in different weeks ... should we prevent that? this.focusDate.w = week; this.$emit('updateMode', 'week'); + Vue.nextTick(()=>{ + let date = new Date(this.focusDate.y, this.focusDate.m, this.focusDate.d); + date = date.getFullYear() + "-" + + String(date.getMonth() + 1).padStart(2, "0") + "-" + + String(date.getDate()).padStart(2, "0"); + this.$router.push({ + name: "LvPlan", + params: { + mode: this.mode[0].toUpperCase() + this.mode.slice(1), + focus_date: date, + lv_id: this.$route.params.lv_id || null + } + }) + }) }, prev(){ this.focusDate.y--;