Ticket 1142 fix previous button on Planning

This commit is contained in:
Jérémy Munsch 2022-12-01 16:40:42 +01:00
parent bf93f7ef92
commit 515cb6505b
No known key found for this signature in database
GPG key ID: 18361AF3BFEC0FEC

View file

@ -597,16 +597,14 @@ export default defineComponent({
if (!route) {
throw new Error("undefined route schedule.index");
}
// console.log(forward);
let date = this.momentJs(this.currentDate)
.startOf("week")
.subtract(7, "day");
if (forward) {
date = this.momentJs(this.currentDate).add(7, "day");
}
const thisWeekMonday = this.momentJs(this.currentDate).startOf("week");
const url = new URL(route);
(window as Window).location =
url.origin + url.pathname + "?p=" + date.format("DD/MM/YYYY");
`${url.origin}${url.pathname}?p=` +
(forward
? thisWeekMonday.add(8, "day")
: thisWeekMonday.subtract(6, "day")
).format("DD/MM/YYYY");
},
prepareDays(): Day[] {
let mydays = [];