From 307adece8a8a5d166e09542fe327adcbd33a5802 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Pluha=C5=99?= Date: Mon, 12 Dec 2022 04:10:41 +0100 Subject: [PATCH] [new #50] center button --- src/components/PlanningTool.jsx | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/components/PlanningTool.jsx b/src/components/PlanningTool.jsx index fc7318f..451ba47 100644 --- a/src/components/PlanningTool.jsx +++ b/src/components/PlanningTool.jsx @@ -1627,7 +1627,19 @@ class PlanningTool extends Component { showOverview = () => { const {defaultTimeStart, defaultTimeEnd} = this.state - this.timeline.current.updateScrollCanvas(defaultTimeStart.valueOf(), defaultTimeEnd.valueOf()) + this.timeline.current.updateScrollCanvas( + defaultTimeStart.valueOf(), + defaultTimeEnd.valueOf() + ) + } + + showCurrentWeek = () => { + const now = moment() + + this.timeline.current.updateScrollCanvas( + now.clone().subtract(84, 'hour').valueOf(), + now.clone().add(84, 'hour').valueOf() + ) } renderGroup = (group) => { @@ -1816,6 +1828,12 @@ class PlanningTool extends Component { > Overview +