Ticket 1142 fix previous button on Planning
This commit is contained in:
parent
bf93f7ef92
commit
515cb6505b
1 changed files with 6 additions and 8 deletions
|
|
@ -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 = [];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue